Skip to content

Commit 710841d

Browse files
committed
docs(skills): the data skill teaches field-change values as on by default
enable.fieldHistory replaces the trackHistory opt-in sentence in skills/objectstack-data/SKILL.md; trackHistory keeps its ledger-view row. New text is paid for by cuts in the same file. Claude-Session: https://claude.ai/code/session_01JQwxbZeHNsF3RWcWpj7rGj Co-authored-by: Claude <noreply@anthropic.com>
1 parent 70f454a commit 710841d

2 files changed

Lines changed: 27 additions & 15 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@objectstack/skills': patch
3+
---
4+
5+
docs(skills): the data skill teaches field-change values as on by default (`enable.fieldHistory`), no longer as the `trackHistory` opt-in
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
`skills/objectstack-data/SKILL.md` still gave `enable.trackHistory`, default `false`, as the field-level audit trail. An agent following it added a flag that no longer decides anything about values, or believed history was off. The `enable` table now has a `fieldHistory` row: a changed field's old → new values show on the record's activity timeline unless the object writes `enable.fieldHistory: false` or the field writes its own `fieldHistory: false`; a media or structured field shows values only with `fieldHistory: true`, and a credential field never does. Each value is served per the reader's read rule for that field, and the audit ledger (`sys_audit_log`) keeps its own grant. The `trackHistory` row now says what the flag still does (the ledger view on the record page and the `history` API verb) and that it is not the values switch.
11+
12+
New text is paid for by cuts in the same file: the `aiReadable` row keeps only what an app author needs (platform objects only, refused at parse on an app object), and nine restating phrases are shortened. No metadata shape changes.

‎skills/objectstack-data/SKILL.md‎

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ same literal goes inside `ObjectSchema.create({...})`):
6666
|:---------|:-------|:-----------|:------------|
6767
| `name` | string | `snake_case` | Immutable machine identifier (`/^[a-z_][a-z0-9_]*$/`) |
6868
| `fields` | map | keys in `snake_case` | Field definitions |
69-
| `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 |
69+
| `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`. Author it on every object |
7070

7171
**`sharingModel` — the four canonical values:**
7272

@@ -77,7 +77,7 @@ same literal goes inside `ObjectSchema.create({...})`):
7777
| `public_read_write` | everyone reads and writes |
7878
| `controlled_by_parent` | inherited from the master record (`master_detail` children); a row with no (optional) master is its owner's |
7979

80-
Choose the posture from the request, not by habit: a business object a team
80+
Choose the posture from the request: a business object a team
8181
shares is `public_read_write` (`private` would hide every colleague's records
8282
from everyone else); `private` fits personal or sensitive data only its owner
8383
should see (HR reviews, pay, personal notes); `public_read` fits reference data
@@ -89,33 +89,34 @@ all (Relationship Patterns below).
8989

9090
| Property | Default | Description |
9191
|:---------|:--------|:------------|
92-
| `label` | Auto from `name` | Human-readable singular label |
92+
| `label` | Auto from `name` | Singular label |
9393
| `pluralLabel` | — | Plural form; author it alongside `label` |
9494
| `icon` | — | Icon for nav, list headers and lookup pickers; give every object one |
9595
| `color` | `gray` | Tile colour behind the white `icon`: `gray` `blue` `teal` `green` `amber` `orange` `red` `pink` `purple` (no hex). Group the app's objects into a few business families, one name each, as the platform's own objects do: people `blue`, security `purple`, approvals and work `orange`, messaging `pink`, integrations `teal`, reference data and finance `green`, audit and settings `amber`. `red` only for an alert object; one nobody opens gets none |
9696
| `highlightFields` | derived | Ordered field keys used as a record's compact face: the columns a **related list** renders on the parent's detail page, and what a lookup picker shows. Declare it on the CHILD object (see [Relationships](./rules/relationships.md)) |
9797
| `namespace` | — | **Not a schema key**: refused as unknown. Embed the prefix in `name` |
98-
| `datasource` | `'default'` | Target datasource ID for virtualized data |
99-
| `nameField` | derived (e.g. `'name'`/`'title'`) | **Canonical** record-title field — the stored field used as the record's display name. Use a single text/email field; a composite title to import, sort or search by is a stored computed field (a non-`formula` field with an `expression`); a text formula is display-only |
98+
| `datasource` | `'default'` | Target datasource ID |
99+
| `nameField` | derived (e.g. `'name'`/`'title'`) | Record-title field: the stored field used as the record's display name. Use a single text/email field; a composite title to import, sort or search by is a stored computed field (a non-`formula` field with an `expression`); a text formula is display-only |
100100
| `displayNameField` | — | **Deprecated** alias for `nameField`, still read |
101101
| `titleFormat` | — | **Refused** by a save and `os validate` (`title-format-retired`): use `nameField` |
102102
| `enable` | — | Capability flags (next section) |
103-
| `fieldGroups` | — | Ordered list of logical field groups for forms/detail pages (see [Field Groups](./references/examples-objects.md#field-groups-mvp)) |
104-
| `lifecycle` | `record` semantics (permanent) | Data retention/rotation/archival contract. **Required for append-only, high-write-rate objects** (see [Data Lifecycle & Retention](./rules/lifecycle.md)) |
103+
| `fieldGroups` | — | Ordered field groups for forms/detail pages (see [Field Groups](./references/examples-objects.md#field-groups-mvp)) |
104+
| `lifecycle` | `record` (permanent) | Data retention/rotation/archival contract. **Required for append-only, high-write-rate objects** (see [Data Lifecycle & Retention](./rules/lifecycle.md)) |
105105

106106
### Object Capabilities (`enable`)
107107

108108
| Flag | Default | Purpose |
109109
|:-----|:--------|:--------|
110-
| `trackHistory` | `false` | Field-level audit trail |
110+
| `fieldHistory` | on | A changed field's old → new values on the activity timeline, served per the reader's field read rule. `false`: off for the object. A field opts out with its own `fieldHistory: false`; a media or structured field (`json`, `address`, `code`…) shows values only with `true`, a credential never. `sys_audit_log` keeps its own grant |
111+
| `trackHistory` | `false` | Ledger view on the record page and the `history` API verb; not the values switch |
111112
| `searchable` | `true` | Index records for global search |
112113
| `apiEnabled` | `true` | Expose via automatic REST + MCP APIs |
113114
| `apiMethods` | all | Whitelist over the six primitives (`get`, `list`, `create`, `update`, `delete`, `bulk`); derived verbs (search/export/upsert/…) follow automatically |
114-
| `files` | `false` | Attachments & document management |
115-
| `feeds` | `true` | Social feed, comments, mentions — **opt-out**: explicit `false` hides the feed UI and rejects new comments |
116-
| `activities` | `true` | Activity timeline (`sys_activity` mirror of CRUD) — **opt-out**: explicit `false` stops mirroring and hides the timeline |
115+
| `files` | `false` | Attachments |
116+
| `feeds` | `true` | Feed, comments, mentions; `false` hides the feed UI and rejects new comments |
117+
| `activities` | `true` | Activity timeline (`sys_activity` mirror of CRUD); `false` stops mirroring and hides the timeline |
117118
| `clone` | `true` | Record deep cloning |
118-
| `aiReadable` | — | Platform `sys_*` objects only (not `sys_metadata`, `sys_metadata_history`): read-only AI access (query, get, aggregate, describe, list; no write). App objects never declare it, `false` included: refused at parse |
119+
| `aiReadable` | — | Platform `sys_*` objects only; on an app object, `false` included, refused at parse |
119120

120121
---
121122

@@ -135,7 +136,7 @@ default, never removes a field the type default scans; declare
135136
search target: unlike `fields` / `sort` / `filters`, the search axis does not
136137
resolve traversal, and `project_id.name` in `searchableFields` (or in a
137138
`$searchFields` override) is **refused** (`os validate`
138-
`searchable-field-unknown`; a request, `400 INVALID_FIELD`), not silently dropped.
139+
`searchable-field-unknown`; a request, `400 INVALID_FIELD`).
139140

140141
**This is the one prescription — emit it every time.** To search by a related
141142
record's title, copy that title into a **stored field on this object** and
@@ -162,8 +163,7 @@ and CEL reads only this record's own fields, so it cannot hold the related title
162163
a `formula` entry in any `searchableFields` is refused — `os validate`
163164
`searchable-field-unsearchable`, a request `400 INVALID_FIELD`.
164165

165-
**Mirror maintenance is the trade-off** — a mirror is only as fresh as whatever
166-
writes it. Cover both paths: a `beforeInsert` / `beforeUpdate` hook on `task`
166+
**Mirror maintenance is the trade-off.** Cover both paths: a `beforeInsert` / `beforeUpdate` hook on `task`
167167
stamps `project_name` from the incoming `project_id`'s parent; an `afterUpdate`
168168
hook on `project` re-stamps its tasks when it is renamed. Rows written past the hooks (bulk import, direct SQL) need a
169169
one-off backfill. See [Lifecycle Hooks](./references/data-hooks.md).

0 commit comments

Comments
 (0)