Skip to content

Commit a1b26ff

Browse files
skills(project): platform catalog lists the built-in sys_task and sys_note objects (#37132)
repo:objectstack#4 · os-justin · session_01QSeKYo86w1wqy2z2fMrryr Fixes #37058 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:做应用的 AI 助手在「平台已自带什么」目录里能查到内置的任务和备忘两个对象,需要待办或备忘时直接用平台的,不再自己另建一套。 - 为什么做:平台新带了任务和备忘,目录没跟上,属于起步应用这条线上技能说明的补漏。 - 出错会怎样:写错的话助手会被引到不存在的视图或权限说法上;只动说明文字和一条测评,撤回这一个合并即可。 - 要你做什么:批准合并。只改技能说明文字、一条测评和生成器测试的文本上限;因为教到行级可见性和 `member_default` 授权,契约审核判它「涉及权限」,按需人工批准处理。另有一处小事随批准认可:生成器测试的手写文本上限 1581→1719,先删 47 字节真重复,余额按实测提高(依裁决 6513306068 的 A 路线)。契约审核 PASS:记录 7145995541,Head-sha `1239e77fd649ba695a64a4217bfc9f7cefae3f04`。 ## What changes - `packages/spec/scripts/lib/platform-catalog.ts`: a new group, "Tasks and notes", with one row each for `sys_task` and `sys_note`. The task row spells the navigation entry with `objectName` and `requiresObject` both `sys_task` (`defineStack` refuses a `type: 'object'` entry naming an object the stack does not declare without `requiresObject`); the note row reuses it, naming `sys_note`. The `sys_comment` row's cell reads "a comments or record-notes table" (notes kept on a record still land there; `sys_note` links to no record). Two same-file restatement cuts: `sys_mail_message` points at the `sys_mailbox` row instead of restating it, and `sys_work_calendar_exception` drops ", kept in Setup" (said on `sys_work_calendar`). - `skills/objectstack-project/references/platform-catalog.md`: regenerated with `pnpm --filter @objectstack/spec gen:skill-refs`, never hand-edited. - `skills/objectstack-project/evals/project-process.json`: eval case 10, a to-do request answered with a navigation entry on `sys_task` carrying `requiresObject`, and no new object. - `packages/spec/scripts/platform-catalog.test.ts`: the hand-written-text ceiling moves from 1581 to 1719 tokens (arithmetic below). - `.changeset/37058-skills-catalog-sys-task-note.md`: `@objectstack/skills` patch. `@objectstack/spec` is not in it: its `files` list ships no `scripts/` path. Every fact in the two rows was read from the merged code at `63ab4794eb`: | Fact in the row | Source | |:--|:--| | task holds title, status, due time, assignee, platform-written `completed_at` | `packages/platform-objects/src/work/sys-task.object.ts` fields; `work/hooks.ts` writes the stamp | | note holds a title and a rich-text body | `work/sys-note.object.ts` fields | | no link to another record | both object docblocks; neither declares a target column | | task views `assigned_to_me`, `created_by_me`, `all` | `sys-task.object.ts` `listViews` | | note views `mine`, `all` | `sys-note.object.ts` `listViews` | | a task is opened by its creator and its assignee | `sharingModel: 'private'` plus the `sys_task_assignee` rule in `work/sharing-rules.ts` | | a note is read by its creator | `sharingModel: 'private'` | | `member_default` grants read, create and edit, not delete | `packages/plugins/plugin-security/src/objects/default-permission-sets.ts`, the `sys_task` and `sys_note` lines | | the nav entry needs `requiresObject` | `packages/spec/src/stack.zod.ts` app-navigation cross-ref; pin in `packages/lint/src/validate-object-references.test.ts` | | data API | neither object declares `enable.apiMethods` | | mounted on every boot | derived by the generator from `PLATFORM_OBJECTS_BY_PACKAGE` | ### Size readings (`skills/**`) | Reading | Before | After | |:--|:--|:--| | `references/platform-catalog.md`, lines | 152 | 159 | | `references/platform-catalog.md`, tokens (`check-skills-token-ratchet`) | 2677 | 2859 | | `evals/project-process.json`, lines | 159 | 176 | | all eval fixtures, tokens | 83745 | 84068 | | every `SKILL.md` in the bundle, lines | 4937 | 4937 | | bundle total, tokens | 296366 | 296871 | ### The ceiling move, and the ruling it rests on The page is generator-owned, so the token ratchet does not price it; its hand-written text has its own shrink-only ceiling in the generator test, and that sat at one token of headroom. - base: 6320 bytes, 1580 tokens, ceiling 1581 - cut first: 47 bytes of restatement (the `sys_mail_message` and `sys_work_calendar_exception` cells above; "no link to another record" said once for both new rows) - added: 602 bytes (the group title, the two rows, the `requiresObject` spelling, "record-notes") - now: 6875 bytes, ceil(6875 / 4) = 1719; the ceiling is pinned at that measurement, 0 headroom The raise follows the path the test's own comment and the ratchet header name, the maintainer's standing ruling 「A:先削重复,余额按实测提高」 (ruling record 6513306068). The remainder is the card's ordered facts, which deletion cannot pay without cutting other rows' teaching. ## Review history - Contract review 7145761197 at `261221ef1b`: FAIL — M1 (the nav entry lacked `requiresObject`), S1 (the `sys_comment` cut lost record notes), nits N1–N4; `Security-touching: yes`, so `security` was added (7145774656) and this PR is Tier H. - Fix round at `1239e77fd6`: M1 and S1 fixed, N2 and N3 folded in, N1 and N4 left; delta review on that head follows on this PR. ## Tests At head `1239e77fd6`: `pnpm --filter @objectstack/spec exec vitest run --project local --maxWorkers=2 scripts/platform-catalog.test.ts` — 20 passed; `pnpm --filter @objectstack/spec build && check:generated` — all 14 generated artifacts up to date; exit 0 for `check:skill-refs`, `check-skills-token-ratchet.mjs`, `check:doc-authoring`, `check:skill-links`, `check:skill-identifier-liveness`, `check:nul-bytes`, `check:issue-citations`, `check:pm-skill-id-lint`, `check-empty-changeset.mjs --base origin/main`; `overlap-check` clean. Every other derived family is left to CI on this head. No ablation: the diff changes generator data, a pin and an eval fixture, and no behaviour a test holds. ## Verification Read first, by risk: 1. `packages/spec/scripts/lib/platform-catalog.ts`, the "Tasks and notes" group: every clause against the table above. 2. `packages/spec/scripts/platform-catalog.test.ts`, the `HAND_WRITTEN_CEILING_TOKENS` hunk: the one number that moved up. 3. `skills/objectstack-project/evals/project-process.json`, case 10. Two minutes: `pnpm --filter @objectstack/spec check:skill-refs` exits 0, and `grep -c 'requiresObject' skills/objectstack-project/references/platform-catalog.md` prints at least 1. --- 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01QSeKYo86w1wqy2z2fMrryr <!-- signed: repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ --> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 8ddadc1 commit a1b26ff

5 files changed

Lines changed: 53 additions & 7 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+
docs(skills): the objectstack-project platform catalog lists the built-in `sys_task` and `sys_note` objects
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
The catalog's "Platform objects an app would otherwise build" section gains a "Tasks and notes" group, so an app that needs to-dos or notes uses the platform's objects instead of declaring its own. Each row says what the object holds, that it carries no link to another record, which list views ship (`assigned_to_me`, `created_by_me`, `all` on `sys_task`; `mine`, `all` on `sys_note`), and that rows are private (a task to its creator and assignee, a note to its creator) while `member_default` grants read, create and edit, not delete, without widening that. The task row spells the navigation entry an app uses: `type: 'object'` with `objectName` and `requiresObject` both `sys_task`. The `sys_comment` row now reads "a comments or record-notes table", since neither new object links to a record. One eval case covers the to-do request.

‎packages/spec/scripts/lib/platform-catalog.ts‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,20 +98,27 @@ export const APP_FACING_OBJECT_GROUPS: readonly { readonly title: string; readon
9898
rows: [
9999
{ name: 'sys_file', builds: 'a file-storage table', reach: '`file` and `image` fields store its rows; uploads go through `/api/v1/storage`' },
100100
{ name: 'sys_attachment', builds: 'an attachments table per object', reach: '`enable.files: true` on the object opens the Attachments panel; data API' },
101-
{ name: 'sys_comment', builds: 'a comments or notes table', reach: '`enable.feeds` (default on) gives every object a discussion thread; data API' },
101+
{ name: 'sys_comment', builds: 'a comments or record-notes table', reach: '`enable.feeds` (default on) gives every object a discussion thread; data API' },
102102
{ name: 'sys_activity', builds: 'a record timeline or history table', reach: '`enable.activities` (default on) mirrors every write; data API read' },
103103
{ name: 'sys_audit_log', builds: 'a change-log or audit table', reach: 'written on every write; data API read, `view_all_audit_log` for rows the caller cannot open' },
104104
{ name: 'sys_recycle_bin', builds: 'an `is_deleted` flag with a restore', reach: 'a by-id delete lands here; `POST /api/v1/data/OBJECT/recycle-bin/ENTRY/restore`; no data API' },
105105
],
106106
},
107+
{
108+
title: 'Tasks and notes',
109+
rows: [
110+
{ name: 'sys_task', builds: 'a task or to-do object', reach: 'a `type: \'object\'` navigation entry with `objectName` and `requiresObject` both `sys_task`. Title, status, due time, assignee, platform-written `completed_at`. Neither it nor `sys_note` links to another record. Views `assigned_to_me`, `created_by_me`, `all`. Private: creator and assignee open a task; `member_default` grants read, create and edit, not delete, without widening that; data API' },
111+
{ name: 'sys_note', builds: 'a notes object', reach: 'as `sys_task`, naming `sys_note`. Title and rich-text body. Views `mine`, `all`. Private to its creator, under the same `member_default` grant; data API' },
112+
],
113+
},
107114
{
108115
title: 'Notifications and mail',
109116
rows: [
110117
{ name: 'sys_notification', builds: 'a notifications table', reach: 'the flow `notify` node, `@mention` and assignment emit rows; data API read' },
111118
{ name: 'sys_inbox_message', builds: 'a per-user inbox with read state', reach: 'the in-app delivery of a notification; the Console bell reads it; data API read' },
112119
{ name: 'sys_email', builds: 'an outbound-mail log', reach: 'every email sent is logged here; templates are `emailTemplates` on the stack; data API read' },
113120
{ name: 'sys_mailbox', builds: 'an inbound-mailbox table', reach: 'engine-owned; data API read for `manage_mailboxes` holders. `requires: [\'mailbox\']` mounts the objects and the ingest seam and syncs nothing: rows exist only where the host composes the mailbox service with an IMAP account source (no Setup entry)' },
114-
{ name: 'sys_mail_message', builds: 'an inbound-mail mirror', reach: 'rows arrive only from the host\'s IMAP sync (the `sys_mailbox` row); `mailAssociation: true` on an email field links messages to records; data API read' },
121+
{ name: 'sys_mail_message', builds: 'an inbound-mail mirror', reach: 'rows as the `sys_mailbox` row says; `mailAssociation: true` on an email field links messages to records; data API read' },
115122
],
116123
},
117124
{
@@ -120,7 +127,7 @@ export const APP_FACING_OBJECT_GROUPS: readonly { readonly title: string; readon
120127
{ name: 'sys_exchange_rate', builds: 'an exchange-rate table', reach: '`currencyConfig.homeAmount` converts at write; Setup edits rates; data API' },
121128
{ name: 'sys_unit', builds: 'a unit table or picklist', reach: '`unitConfig` on a `number` field (`unitMode: \'fixed\'` with `unit`, `\'record\'` with `unitField`) or a `text` field (`\'code\'`); a stored code is standard (UN/ECE Rec 20: `KGM`, `H87`) or a row added here in Setup; data API, no delete' },
122129
{ name: 'sys_work_calendar', builds: 'a business-hours calendar', reach: 'kept per organization in Setup; an approval\'s `escalation.clock: \'working_time\'` and `addWorkingDays()`, `workingDaysBetween()`, `addWorkingHours()` read it; data API' },
123-
{ name: 'sys_work_calendar_exception', builds: 'a holiday table', reach: 'a calendar\'s holidays and make-up workdays, kept in Setup; data API' },
130+
{ name: 'sys_work_calendar_exception', builds: 'a holiday table', reach: 'a calendar\'s holidays and make-up workdays; data API' },
124131
{ name: 'sys_import_job', builds: 'a bulk-import job table', reach: '`POST /api/v1/data/OBJECT/import/jobs`; data API read' },
125132
{ name: 'sys_approval_request', builds: 'an approvals table', reach: 'a flow approval node opens it; `/api/v1/approvals` routes decide; data API read' },
126133
{ name: 'sys_approval_action', builds: 'an approval decision trail', reach: 'written per decision; data API read' },

‎packages/spec/scripts/platform-catalog.test.ts‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,12 @@ describe('pricing — the hand-written text is ratcheted, shrink-only', () => {
181181
// 6331 bytes -> ceil(6331 / 4) = 1583 (2026-11-19, the PR that adds the page)
182182
// 6321 bytes -> 1581 (the same PR's second review round: the Planned paragraph
183183
// gained the unit-code clause, paid by four cuts in PROSE; lowered to the measurement)
184-
const HAND_WRITTEN_CEILING_TOKENS = 1581;
184+
// 6875 bytes -> ceil(6875 / 4) = 1719 (the PR that adds the `sys_task` and `sys_note`
185+
// rows: 6320 on its base, 47 bytes of restatement cut first — `sys_mail_message` points
186+
// at the `sys_mailbox` row for where rows come from, `sys_work_calendar_exception` leaves
187+
// "kept in Setup" to its calendar's row — then 602 added; raised by the measured
188+
// remainder under the ratchet header's standing ruling, 「A:先削重复,余额按实测提高」)
189+
const HAND_WRITTEN_CEILING_TOKENS = 1719;
185190

186191
it('measures every hand-written string the page carries and nothing derived', () => {
187192
const page = renderPlatformCatalog();

‎skills/objectstack-project/evals/project-process.json‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,23 @@
154154
"event: 'afterUpdate'"
155155
]
156156
}
157+
},
158+
{
159+
"id": 10,
160+
"prompt": "People using our ObjectStack app need a to-do list: a task has a title, a status, a due date and the person it is assigned to. Create a `todo` object with those fields and put it in the app's menu.",
161+
"expected_output": "Does not create the object: the platform catalog lists `sys_task` as what the platform ships for tasks and to-dos, on every boot, holding a title, a status, a due time, an assignee and a `completed_at` the platform writes. Adds a `type: 'object'` navigation entry with `objectName: 'sys_task'` and `requiresObject: 'sys_task'`, because `defineStack` refuses an entry naming an object the stack does not declare without it (its shipped views are `assigned_to_me`, `created_by_me` and `all`) and declares nothing else. Says that a task is private to its creator and its assignee and that `member_default` already lets every member read, create and edit tasks, so no permission set or sharing rule is written; and that the object carries no link to another record yet.",
162+
"files": [],
163+
"assertions": {
164+
"must_contain": [
165+
"sys_task",
166+
"type: 'object'",
167+
"requiresObject"
168+
],
169+
"must_not_contain": [
170+
"name: 'todo'",
171+
"name: 'task'"
172+
]
173+
}
157174
}
158175
]
159176
}

‎skills/objectstack-project/references/platform-catalog.md‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,18 @@ a seed) without declaring it.
3030
|:--|:--|:--|:--|
3131
| `sys_file` | every boot (`storage`) | a file-storage table | `file` and `image` fields store its rows; uploads go through `/api/v1/storage` |
3232
| `sys_attachment` | every boot | an attachments table per object | `enable.files: true` on the object opens the Attachments panel; data API |
33-
| `sys_comment` | `requires: ['audit']` | a comments or notes table | `enable.feeds` (default on) gives every object a discussion thread; data API |
33+
| `sys_comment` | `requires: ['audit']` | a comments or record-notes table | `enable.feeds` (default on) gives every object a discussion thread; data API |
3434
| `sys_activity` | `requires: ['audit']` | a record timeline or history table | `enable.activities` (default on) mirrors every write; data API read |
3535
| `sys_audit_log` | `requires: ['audit']` | a change-log or audit table | written on every write; data API read, `view_all_audit_log` for rows the caller cannot open |
3636
| `sys_recycle_bin` | every boot | an `is_deleted` flag with a restore | a by-id delete lands here; `POST /api/v1/data/OBJECT/recycle-bin/ENTRY/restore`; no data API |
3737

38+
### Tasks and notes
39+
40+
| Object | Mounted by | What you would otherwise build | How the app reaches it |
41+
|:--|:--|:--|:--|
42+
| `sys_task` | every boot | a task or to-do object | a `type: 'object'` navigation entry with `objectName` and `requiresObject` both `sys_task`. Title, status, due time, assignee, platform-written `completed_at`. Neither it nor `sys_note` links to another record. Views `assigned_to_me`, `created_by_me`, `all`. Private: creator and assignee open a task; `member_default` grants read, create and edit, not delete, without widening that; data API |
43+
| `sys_note` | every boot | a notes object | as `sys_task`, naming `sys_note`. Title and rich-text body. Views `mine`, `all`. Private to its creator, under the same `member_default` grant; data API |
44+
3845
### Notifications and mail
3946

4047
| Object | Mounted by | What you would otherwise build | How the app reaches it |
@@ -43,7 +50,7 @@ a seed) without declaring it.
4350
| `sys_inbox_message` | every boot (`messaging`) | a per-user inbox with read state | the in-app delivery of a notification; the Console bell reads it; data API read |
4451
| `sys_email` | every boot | an outbound-mail log | every email sent is logged here; templates are `emailTemplates` on the stack; data API read |
4552
| `sys_mailbox` | `requires: ['mailbox']` | an inbound-mailbox table | engine-owned; data API read for `manage_mailboxes` holders. `requires: ['mailbox']` mounts the objects and the ingest seam and syncs nothing: rows exist only where the host composes the mailbox service with an IMAP account source (no Setup entry) |
46-
| `sys_mail_message` | `requires: ['mailbox']` | an inbound-mail mirror | rows arrive only from the host's IMAP sync (the `sys_mailbox` row); `mailAssociation: true` on an email field links messages to records; data API read |
53+
| `sys_mail_message` | `requires: ['mailbox']` | an inbound-mail mirror | rows as the `sys_mailbox` row says; `mailAssociation: true` on an email field links messages to records; data API read |
4754

4855
### Money, imports and approvals
4956

@@ -52,7 +59,7 @@ a seed) without declaring it.
5259
| `sys_exchange_rate` | every boot | an exchange-rate table | `currencyConfig.homeAmount` converts at write; Setup edits rates; data API |
5360
| `sys_unit` | every boot | a unit table or picklist | `unitConfig` on a `number` field (`unitMode: 'fixed'` with `unit`, `'record'` with `unitField`) or a `text` field (`'code'`); a stored code is standard (UN/ECE Rec 20: `KGM`, `H87`) or a row added here in Setup; data API, no delete |
5461
| `sys_work_calendar` | every boot | a business-hours calendar | kept per organization in Setup; an approval's `escalation.clock: 'working_time'` and `addWorkingDays()`, `workingDaysBetween()`, `addWorkingHours()` read it; data API |
55-
| `sys_work_calendar_exception` | every boot | a holiday table | a calendar's holidays and make-up workdays, kept in Setup; data API |
62+
| `sys_work_calendar_exception` | every boot | a holiday table | a calendar's holidays and make-up workdays; data API |
5663
| `sys_import_job` | every boot | a bulk-import job table | `POST /api/v1/data/OBJECT/import/jobs`; data API read |
5764
| `sys_approval_request` | `requires: ['approvals']` | an approvals table | a flow approval node opens it; `/api/v1/approvals` routes decide; data API read |
5865
| `sys_approval_action` | `requires: ['approvals']` | an approval decision trail | written per decision; data API read |

0 commit comments

Comments
 (0)