Skip to content

Commit d7f1ca5

Browse files
authored
Merge pull request #82 from objectstack-ai/claude/issue-78-align-docs-with-17-0
docs: align pages with framework 17.0
2 parents 511e2e4 + 8fe88ba commit d7f1ca5

19 files changed

Lines changed: 386 additions & 37 deletions

‎content/docs/build/ai-skills.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ versions.
4242
| `objectstack-ui` | Views, Apps, Pages, Dashboards, Reports, Charts, Actions |
4343
| `objectstack-automation` | Flows, Workflows, Triggers, Approvals, schedules, webhooks |
4444
| `objectstack-ai` | Agents, Tools, Skills, Conversations, Model Registry, MCP |
45-
| `objectstack-api` | REST/GraphQL endpoints, auth, realtime, error envelopes |
45+
| `objectstack-api` | REST endpoints, auth providers, realtime channels, error envelopes, batch/versioning contracts |
4646
| `objectstack-i18n` | Translation bundles, locale fallback, coverage |
4747
| `objectstack-formula` | CEL expressions — formula fields, validation/sharing/visibility predicates, conditions |
4848

‎content/docs/build/automation/approvals.mdx‎

Lines changed: 91 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,32 @@ The node declares **who approves** and how their decisions aggregate:
5656

5757
| Config | What it does |
5858
|---|---|
59-
| `approvers` | Who must decide — a named user, a position, or a user resolved from a record field (e.g. the submitter's manager) |
59+
| `approvers` | Who must decide — see the approver types below |
6060
| `behavior` | How multiple approvers aggregate: `'first_response'` (default), `'unanimous'`, `'quorum'`, `'per_group'` |
6161
| `minApprovals` | Approvals required — total for `quorum` (M of N), per group for `per_group` (default 1) |
62+
| `onEmptyApprovers` | What happens when approver resolution yields nobody: `'admin_rescue'` (default), `'fail'`, `'auto_approve'` |
63+
| `decisionOutputs` | Keys a decision may carry back into the flow as structured outputs |
6264
| `approvalStatusField` | Optional record field the plugin mirrors the request status into |
6365
| `lockRecord` | Lock the record against edits while the request is pending |
6466

67+
Each entry in `approvers` names a `type` and a `value`:
68+
69+
| `type` | Resolves to |
70+
|---|---|
71+
| `manager` | The submitter's manager (`sys_user.manager_id`) — takes no value |
72+
| `position` | Holders of an org position |
73+
| `department` | Members of a business unit **and all descendant units** |
74+
| `team` | Members of a flat collaboration team |
75+
| `field` | The user id held in a field on the triggering record |
76+
| `user` | One named user id |
77+
| `org_membership_level` | An org-membership tier (`owner` / `admin` / `member`) |
78+
| `expression` | A CEL expression resolved at node entry — see below |
79+
80+
Prefer the indirect bindings (`manager`, `position`, `department`,
81+
`team`) over a literal `user` id: they survive the person changing team
82+
or leaving, and a hard-coded id silently routes approvals to someone who
83+
should no longer see them.
84+
6585
> **Warning — `position` vs the membership tier.**
6686
> `{ type: 'position', value: 'finance_manager' }` routes to the holders of a
6787
> position (`sys_user_position`). The org-membership tier (`sys_member.role`:
@@ -117,6 +137,76 @@ Semantics that hold across every mode:
117137
- Approvers without a `group` label each form their own group, so a plain
118138
approver list still behaves sensibly under `per_group`.
119139

140+
### Dynamic routing: an approver picks the next approver (17.0)
141+
142+
Three additions in 17.0 let a node decide its approvers from what the
143+
run has produced so far, instead of from a fixed declaration.
144+
145+
**`expression` approvers** resolve a CEL expression at node entry
146+
against three explicit roots — `current.*` (the record's live state),
147+
`trigger.*` (the submit-time snapshot), and `vars.*` (flow variables,
148+
including upstream node outputs). The result becomes the approver
149+
slate:
150+
151+
```ts
152+
config: {
153+
approvers: [
154+
{ type: 'expression', value: 'vars.legal_review.picked_departments' },
155+
],
156+
resolveAs: 'department', // each value is a department id, fanned out to its members
157+
}
158+
```
159+
160+
`resolveAs` (`'user'` by default, or `'department'` / `'position'` /
161+
`'team'`) says what kind of id the expression returned, and expands each
162+
through the same graph lookups the static approver types use. Under
163+
`behavior: 'per_group'`, each returned value forms its own group — one
164+
sign-off per returned department.
165+
166+
`record` and bare field names are deliberately **not** available: on
167+
every other platform surface `record` means "the record at event time",
168+
and reusing it here would silently alias one of the two times.
169+
170+
**`decisionOutputs`** is what feeds an expression like the one above.
171+
The *author* declares which keys a decision may carry; approvers only
172+
fill in values. Accepted outputs resume the run as
173+
`<nodeId>.<key>` flow variables — never bare names, so an approver
174+
cannot shadow an author's variable:
175+
176+
```ts
177+
{
178+
id: 'legal_review',
179+
type: 'approval',
180+
config: {
181+
approvers: [{ type: 'position', value: 'legal_counsel' }],
182+
decisionOutputs: [
183+
{ key: 'picked_departments', type: 'department', multiple: true },
184+
],
185+
},
186+
}
187+
```
188+
189+
An entry is either a bare key (rendered as a plain text input in the
190+
decision UI) or a typed declaration — `{ key, type, multiple }` — which
191+
tells the decision UI to render a record picker instead:
192+
`user` / `department` / `position` / `team` each get the matching
193+
system-object picker, and `multiple: true` collects an id array. A
194+
decision carrying undeclared keys is rejected; `decision` and
195+
`requestId` are reserved.
196+
197+
**`onEmptyApprovers`** decides what happens when resolution yields no
198+
concrete person — an empty expression result, an unstaffed position, an
199+
empty multi-select field:
200+
201+
| Value | Behavior |
202+
|---|---|
203+
| `'admin_rescue'` (default) | Open the request anyway and warn loudly; a privileged admin can take it over via Reassign. The only option that neither waves the record through nor kills the run |
204+
| `'fail'` | The node fails (fault edge / run failure). Choose when an empty slate can only mean a configuration bug |
205+
| `'auto_approve'` | Skip the request and continue down the `approve` edge with `output.autoApproved = true`. Opt-in, because it silently waves the record through |
206+
207+
The default is deliberate: approval's job is to gatekeep, so an empty
208+
slate must never silently pass.
209+
120210
## A complete approval flow
121211

122212
Route large proposals to the owner's manager, then branch on the decision:

‎content/docs/build/data/index.mdx‎

Lines changed: 47 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -212,23 +212,61 @@ ObjectSchema.create({
212212
ownership: 'own', // 'own' | 'shared' | 'system'
213213
sharingModel: 'private', // OWD — custom objects default to private (v13)
214214
enable: {
215-
apiEnabled: true, // generated REST endpoints
216-
trackHistory: true, // History tab + field-level diffs (default true)
215+
apiEnabled: true, // generated REST endpoints (default true)
216+
searchable: true, // index records for global search (default true)
217+
trackHistory: true, // History tab + field-level diffs (opt-in, default false)
217218
feeds: true, // sys_comment / @mentions (default true)
218219
activities: true, // mirror CRUD to sys_activity timeline (default true)
219-
files: true, // Attachments panel (opt-in, default false)
220-
trash: true, // soft-delete with restore (default true)
220+
files: false, // Attachments panel (opt-in, default false)
221+
clone: true, // record deep cloning (default true)
221222
},
222223
});
223224
```
224225

225-
> **Changed in 16.0:** the object-level `softDelete` prop is removed —
226-
> `ObjectSchema.create` now throws a located error if you pass it. The
227-
> shipped equivalent is `enable: { trash: true }` (soft-delete with
228-
> restore), on by default. The same cleanup removed `versioning`,
226+
`enable` is a **closed vocabulary** — the block is strict, so an
227+
unrecognized flag (a typo like `feedEnabled`, or a key that used to
228+
exist) is a parse error naming the key, not a silently dropped setting.
229+
The seven flags above are the whole of it, plus one more key:
230+
231+
```ts
232+
enable: {
233+
apiMethods: ['get', 'list', 'create', 'update'], // no delete over the API
234+
}
235+
```
236+
237+
`apiMethods` whitelists which API operations the object exposes. The
238+
authorable vocabulary is exactly six primitives — `get`, `list`,
239+
`create`, `update`, `delete`, `bulk`. Omit the key for unrestricted
240+
access; `[]` means deny-all. The eight legacy values (`upsert`,
241+
`import`, `export`, `aggregate`, `search`, `history`, `restore`,
242+
`purge`) are *derived* effective operations, not things you declare:
243+
a stored one still parses but is stripped with a warning naming its
244+
replacement (`upsert` → `create` + `update`, `export`/`aggregate`/
245+
`search` → `list`, `history` → `get`; `restore` and `purge` derive from
246+
nothing and are simply deleted). Watch one cliff — a whitelist of
247+
*only* legacy values strips to `[]`, which closes the object's API
248+
rather than widening it.
249+
250+
> **There is no soft delete — `enable.trash` was removed.**
251+
> Earlier docs pointed at `enable: { trash: true }` as the replacement
252+
> for the retired object-level `softDelete` prop. That was wrong in a way
253+
> worth stating plainly: `trash` never had a runtime consumer. Every
254+
> delete has always been a hard delete, so a default-true flag promising
255+
> a recycle bin was a false affordance — authors wrote `trash: false`
256+
> believing they were opting out of a soft delete that never ran. The key
257+
> (and its neighbour `enable.mru`) is now **rejected at parse time** with
258+
> guidance rather than ignored. Delete it from your source, or run
259+
> `os migrate meta --from 16` to rewrite it for you.
260+
>
261+
> For recoverability, use per-field `trackHistory` (an audit trail of what
262+
> changed) or a [`lifecycle`](#data-lifecycle-retention) policy. A real
263+
> recycle bin is not a shipped capability today.
264+
265+
> **Also removed from the object surface:** `softDelete`, `versioning`,
229266
> `search` (use top-level `searchableFields`), `recordName` (use an
230267
> autonumber field as `nameField`), `keyPrefix`, `tags`, `active`, and
231-
> `abstract`.
268+
> `abstract` — `ObjectSchema.create` throws a located error naming the
269+
> replacement if you pass one.
232270
233271
Since ObjectStack 14 the `enable.*` flags are **enforced**, not
234272
advisory: `feeds: false` rejects comment creation with 403

‎content/docs/configure/data-sources.mdx‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ A **datasource** is a named connection to an external data store. By
77
declaring datasources, you point ObjectOS at the databases your business
88
already runs on — a production PostgreSQL, a reporting MySQL replica, a
99
MongoDB cluster — and then bind objects to them. Once an object is bound,
10-
everything else in the platform (the REST/GraphQL API, permissions,
10+
everything else in the platform (the REST API, permissions,
1111
flows, dashboards, and **AI agents**) works against that data uniformly,
1212
without caring where the rows physically live.
1313

@@ -110,6 +110,19 @@ export const Customer = ObjectSchema.create({
110110
});
111111
```
112112

113+
> **A datasource that objects bind to must connect, or the boot fails.**
114+
> Since ObjectStack 17.0 an unreachable datasource is a startup failure,
115+
> not a warning line. Previously only an `external` datasource with
116+
> `validation.onMismatch: 'fail'` fail-fasted: an app declaring
117+
> `datasource: 'analytics'` with objects bound to it, booted against a
118+
> wrong URL, started clean and exited zero — then failed every read and
119+
> write of those objects with `Datasource 'x' is not registered`.
120+
> `/api/v1/ready` also reports **503** when a data driver stops
121+
> answering, so a replica whose database has gone away is taken out of
122+
> rotation instead of serving errors. Connection attempts are bounded at
123+
> 10 seconds. See the
124+
> [17.0 release notes](https://docs.objectstack.ai/docs/releases/v17).
125+
113126
### Centralized routing with `datasourceMapping`
114127

115128
Binding objects one by one is fine for a handful. For whole namespaces or

‎content/docs/configure/permissions/index.mdx‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ to users directly or via positions.
8080
| Application access | Open CRM, open the support portal |
8181
| Object permissions | Create / read / update / delete records of an object |
8282
| Field permissions | Read or update specific fields |
83-
| System permissions | Access Console, run reports, export data, view audit log |
83+
| System permissions | Access Console, run reports, view audit log |
8484
| Integration permissions | Use API keys, configure webhooks, run admin actions |
8585

8686
### Object permission flags
@@ -93,13 +93,23 @@ These are the exact flag names the security plugin checks:
9393
| `allowCreate` | Create new records |
9494
| `allowEdit` | Update records the user can see |
9595
| `allowDelete` | Delete records the user can see |
96+
| `allowExport` | Take a bulk, machine-readable copy of the object's records |
9697
| `viewAllRecords` | Read **every** record for the object, ignoring record-access rules |
9798
| `modifyAllRecords` | Update/delete **every** record; implies `viewAllRecords` |
9899

99100
`viewAllRecords` and `modifyAllRecords` are tenant-wide super-user
100101
grants for that object. Reserve them for explicit administrative
101102
permission sets and keep them out of any user-facing position.
102103

104+
**Export is its own opt-in grant.** `allowExport` unset means
105+
**denied** — it does not inherit from `allowRead`, and `viewAllRecords` /
106+
`modifyAllRecords` do **not** confer it. Reading a record and taking a
107+
machine-readable copy of a whole table are different acts, and this is
108+
the segregation-of-duties axis that separates them. Grant it explicitly
109+
on the object entry (or the `'*'` wildcard) of every set whose holders
110+
should export. See
111+
[Permission Sets](/docs/configure/permissions/permission-sets#export-is-its-own-grant).
112+
103113
See [Permission Sets](/docs/configure/permissions/permission-sets).
104114

105115
## Layer 4 — Record access

‎content/docs/configure/permissions/managing-access.mdx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,8 @@ When translating a requirement into a change, pick the matching layer:
144144
| Can read/create/edit/delete an object type | Object permissions | [Permission Sets](/docs/configure/permissions/permission-sets) |
145145
| Can see / edit a specific field | Field-level security | [Field-Level Security](/docs/configure/permissions/field-level-security) |
146146
| Which *rows* a user sees | Record access | [Record Access](/docs/configure/permissions/record-access) |
147-
| A functional capability (export, manage users) | System permissions | [Permission Sets](/docs/configure/permissions/permission-sets#system-permissions) |
147+
| Can bulk-export an object's records | Object permissions — `allowExport`, an opt-in grant that read does **not** confer | [Export is its own grant](/docs/configure/permissions/permission-sets#export-is-its-own-grant) |
148+
| A functional capability (manage users, view audit logs) | System permissions | [Permission Sets](/docs/configure/permissions/permission-sets#system-permissions) |
148149
| Can open an app or nav entry | Application access | [Permission Sets](/docs/configure/permissions/permission-sets) |
149150

150151
## Quick paths

‎content/docs/configure/permissions/permission-sets.mdx‎

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ resolving immediately.
1616
| Application access | User can open CRM or Console |
1717
| Object permissions | Create, read, update, delete records |
1818
| Field permissions | Read or update selected fields |
19-
| System permissions | Access Console, run reports, export data |
19+
| System permissions | Access Console, run reports, view audit logs |
2020
| Integration permissions | Use API keys, webhooks, or admin actions |
2121

2222
## Object permissions
@@ -36,6 +36,7 @@ plugin's permission evaluator):
3636
| `allowCreate` | Create records |
3737
| `allowEdit` | Update records allowed by record access rules |
3838
| `allowDelete` | Delete records allowed by record access rules |
39+
| `allowExport` | Take a bulk, machine-readable copy of the object's records |
3940
| `viewAllRecords` | Read every record for the object, bypassing record access |
4041
| `modifyAllRecords` | Update or delete every record for the object, bypassing record access; implies `viewAllRecords` for reads |
4142

@@ -45,6 +46,46 @@ row-level boundary. Reserve those flags for
4546
administrative permission sets — they are effectively a tenant-wide
4647
super-user grant for that object.
4748

49+
### Export is its own grant
50+
51+
Export is an **object permission**, not a system permission, and it is
52+
**opt-in**:
53+
54+
| `allowExport` | Result |
55+
|---|---|
56+
| unset | export **denied** |
57+
| `false` | denied |
58+
| `true` | allowed (still bounded by `allowRead`) |
59+
60+
Unset used to mean "inherit read". Since ObjectStack 17.0 it means
61+
denied, and `viewAllRecords` / `modifyAllRecords` no longer confer it
62+
either — "may see all data" and "may take a bulk copy of it" are
63+
deliberately different grants.
64+
65+
```ts
66+
objects: {
67+
deal: { allowRead: true, allowExport: true }, // ← add the grant
68+
}
69+
```
70+
71+
Three consequences worth planning for:
72+
73+
- **Package-shipped sets are re-seeded on upgrade**, so
74+
`admin_full_access` and `organization_admin` carry `allowExport: true`
75+
for you. **Environment-authored sets are not** — edit any custom set
76+
whose users export.
77+
- **`member_default` deliberately does not carry the grant**, so ordinary
78+
authenticated users lose export until an admin grants it. That is the
79+
point of the flip, not an oversight.
80+
- **A set carrying `allowExport` is high-privilege**, so it cannot be
81+
bound to the `everyone` or `guest` audience anchors — otherwise the
82+
opt-in would be defeatable by binding an exporting set to an anonymous
83+
anchor.
84+
85+
Merge is most-permissive, exactly like the CRUD bits: any assigned set
86+
granting `true` grants export, and `false` and unset produce the same
87+
outcome. Reports are covered by the same axis.
88+
4889
## System permissions
4990

5091
System permissions are for platform actions such as:
@@ -53,7 +94,6 @@ System permissions are for platform actions such as:
5394
- manage users;
5495
- manage positions and permission sets;
5596
- run reports;
56-
- export reports;
5797
- manage integrations;
5898
- view audit logs.
5999

‎content/docs/configure/permissions/record-access.mdx‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,33 @@ Use sharing rules for repeatable business policies:
6161
- finance can read approved invoices;
6262
- auditors can read records tagged for audit review.
6363

64+
A rule is a CEL `condition` over field values, compiled at author time
65+
into a row filter; matching records materialize `sys_record_share`
66+
grants for the resolved recipients (a user, team, position, business
67+
unit, or a unit and its subordinates). `criteria` rules are the only
68+
authorable form.
69+
70+
### Both switches fail closed
71+
72+
Two things a reader is entitled to assume, and which have been true only
73+
since ObjectStack 17.0:
74+
75+
- **A sharing rule with no criteria shares nothing.** A rule stored
76+
without a criteria predicate used to evaluate as *every record of the
77+
object* — the empty filter — so a typo through an unvalidated write
78+
path silently opened the whole table. Writing a match-all criteria is
79+
now rejected, and the evaluator treats an empty one as matching
80+
**nothing**.
81+
- **An RLS policy with `enabled: false` is disabled.** A policy switched
82+
off used to keep contributing its OR-branch grant, so turning a policy
83+
off did not take the access away. A disabled policy is now simply not
84+
evaluated.
85+
86+
If you audited access under an earlier release and concluded "this rule
87+
grants nothing" or "this policy is off", it is worth re-running the
88+
[explain engine](/docs/configure/permissions#diagnose--audit) — the
89+
answer may have been wider than the metadata said.
90+
6491
## Record shares
6592

6693
Use record shares for exceptions:

‎content/docs/deploy/docker.mdx‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,13 @@ has to reproduce it:
119119

120120
Two HTTP endpoints exist for this, and they are not interchangeable:
121121
`/api/v1/health` for liveness and `/api/v1/ready` for readiness.
122+
Readiness is backed by the data layer: since ObjectStack 17.0
123+
`/api/v1/ready` answers **503** when a data driver stops answering, so a
124+
replica whose database has gone away is pulled from rotation rather than
125+
left serving errors. A datasource that objects bind to must also connect
126+
at startup or the boot fails outright — an unreachable database is a
127+
failed deploy, not a container that comes up and then errors on every
128+
request.
122129

123130
In production, point the deployment at your **managed** PostgreSQL (and Redis,
124131
if you cluster) and remove the bundled database services. Give the proxy your

‎content/docs/deploy/kubernetes.mdx‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ variable.
3939
different questions, and using one for both means either routing traffic at a
4040
replica that is not ready, or restarting a replica that is merely busy.
4141

42+
Since ObjectStack 17.0 readiness is backed by the data layer:
43+
`/api/v1/ready` answers **503** when a data driver stops answering, so a
44+
readiness probe pointed at it will correctly pull a replica out of the
45+
Service endpoints when its database goes away. Keep it off the liveness
46+
probe for exactly that reason — a shared database outage would otherwise
47+
restart every replica at once instead of draining traffic.
48+
4249
### Every replica gets identical secrets
4350

4451
Multi-replica is not a matter of raising the replica count:

0 commit comments

Comments
 (0)