Skip to content

Commit baf689c

Browse files
os-zhuangclaude
andauthored
docs: close week-of doc gaps — os publish removal, RLS current_user, search, authz, SDUI styling, dataset joins, package-first (#2338)
Audit of ~1 week of changes (298 commits, 3 breaking, 20 new ADRs) surfaced hand-written docs that were stale or missing. All shapes verified against the current spec/CLI. P1 — docs were WRONG: - os publish / os rollback removed (#2237): rewrite publish-and-preview around `os package publish`; fix cloud-deployment, cloud-artifact-api, protocol objectos/objectql docs, README, platform skill (migration `os rollback` is gone too — migrate is plan/apply, forward-only). - RLS current_user (ADR-0068): permission.mdx + core-concepts dropped the removed singular `current_user.role` / `current_user.region`; `roles` is a string array. - sharingModel enum (ADR-0055/0056): object.mdx adds public_read / public_read_write / controlled_by_parent + legacy aliases. P2 — shipped but undocumented: - Record search (ADR-0061): data-modeling — `searchableFields` + `$search`. - Unified authz (ADR-0066): security — `sys_capability` registry, object `access` posture, object `requiredPermissions`. - SDUI styling (ADR-0065): page.mdx — `responsiveStyles` (preferred channel). - Dataset multi-hop joins (ADR-0071): analytics-datasets — dotted paths, <=3 hops, to-one only. - Package-first authoring (ADR-0070): metadata-lifecycle — writable-base contract. P3: - Built-in identity roles (ADR-0068) in security; per-env @better-auth/sso + `features.sso` note in auth-sso (ADR-0069). - Status-header correction on ADR-0061 / ADR-0071 (code shipped; headers lagged). Docs-only. Build Docs CI validates MDX. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 44bb971 commit baf689c

20 files changed

Lines changed: 163 additions & 109 deletions

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ os doctor # Check environment health
177177
os explain # Explain protocol concepts on the command line
178178
```
179179

180-
Cloud, package registry, and environment management subcommands (`os publish`, `os rollback`, `os package`, `os login`, `os whoami`, `os cloud …`) are available when targeting an ObjectStack Cloud control plane.
180+
Cloud, package registry, and environment management subcommands (`os package publish`, `os package install`, `os login`, `os whoami`, `os environments`, `os cloud …`) are available when targeting an ObjectStack Cloud control plane.
181181

182182
## Use the generated API
183183

content/docs/concepts/cloud-artifact-api.mdx

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,15 @@ caches.
3737
}
3838
```
3939

40-
The CLI command is:
40+
This control-plane endpoint is driven by the Cloud / Marketplace install flow.
41+
The framework CLI publishes through the package catalog:
4142

4243
```bash
43-
OS_CLOUD_URL=https://cloud.example.com \
44-
OS_ENVIRONMENT_ID=env_prod \
45-
os publish
44+
os package publish ./dist/objectstack.json --env env_prod --install
4645
```
4746

47+
(The legacy direct-to-environment `os publish` CLI was removed — #2237.)
48+
4849
---
4950

5051
## Activate revision endpoint
@@ -57,11 +58,9 @@ Activating a revision changes the environment's current artifact pointer.
5758
Runtime nodes can then reload or refresh their environment kernel based on the
5859
new commit/checksum.
5960

60-
```bash
61-
OS_CLOUD_URL=https://cloud.example.com \
62-
OS_ENVIRONMENT_ID=env_prod \
63-
os rollback --commit 9ce1bd48dd7022b8
64-
```
61+
Revision activation is a Cloud control-plane operation. The framework `os rollback`
62+
CLI was removed (#2237); to change an environment's active artifact, install the
63+
desired package version into it.
6564

6665
---
6766

content/docs/concepts/metadata-lifecycle.mdx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,20 @@ The `seq` is the single source of truth for ordering. The Studio status badge (`
7676

7777
---
7878

79+
## Package-first authoring (ADR-0070)
80+
81+
Every runtime-authored item lives inside a **writable package** — there are no
82+
orphans. Code-defined and installed packages are **read-only** at runtime, so the
83+
first step of any Studio/API authoring action is to target a *writable* package (a
84+
"base"): a create/update aimed at a read-only package is rejected, and the author
85+
is asked to pick or create a writable base first. New objects, fields, views, and
86+
flows are namespaced into that package — which is exactly what `os package publish`
87+
later ships. See [ADR-0070](https://github.com/objectstack-ai/framework/blob/main/docs/adr/0070-package-first-authoring.md).
88+
89+
> Note: "package" here is the runtime **authoring base** (a `package_id`-bearing
90+
> container of metadata), distinct from the npm `@objectstack/*` packages listed in
91+
> the repo README.
92+
7993
## Overlay whitelist (shared-DB tenancy invariant)
8094

8195
In shared-database multi-tenancy, **most metadata types must not be per-org customizable** — overriding them would break the physical schema. The whitelist lives in **one** place: `MetadataTypeRegistryEntry.allowOrgOverride` in `packages/spec/src/kernel/metadata-plugin.zod.ts`.

content/docs/getting-started/core-concepts.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ This ensures ObjectStack apps can run on Node.js + PostgreSQL today, Python + SQ
137137
| **Engine** | Enforces the logic | Compiles the `using` condition into a SQL `WHERE` clause |
138138

139139
<Callout type="info">
140-
CRUD permissions (`allowRead`, `allowEdit`, …) are simple booleans — they grant or deny an operation. Record-level *conditional* access is a separate mechanism: [Row-Level Security](/docs/getting-started/architecture) policies, whose `using` clause is a SQL-like (PostgreSQL-compatible) predicate over context variables such as `current_user.role` and `current_user.id`.
140+
CRUD permissions (`allowRead`, `allowEdit`, …) are simple booleans — they grant or deny an operation. Record-level *conditional* access is a separate mechanism: [Row-Level Security](/docs/getting-started/architecture) policies, whose `using` clause is a SQL-like (PostgreSQL-compatible) predicate over context variables such as `current_user.roles` and `current_user.id`.
141141
</Callout>
142142

143143
### Single Source of Truth

content/docs/guides/analytics-datasets.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,11 @@ capability the inline single-object query could never reach:
135135
// → revenue by account.region, joined + RLS-enforced per object.
136136
```
137137

138+
Joins follow **dotted relationship paths** and may traverse **multiple to-one hops**
139+
(ADR-0071) — e.g. `account.owner.region` walks the chain order → account → owner →
140+
region. The path is capped at **3 join hops (4 objects)** and is **to-one only**;
141+
to-many traversal is rejected (aggregate the many-side as its own measure instead).
142+
138143
## How it runs
139144

140145
A dataset compiles to the **Cube analytics runtime** (`IAnalyticsService`). The

content/docs/guides/auth-sso.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,12 @@ Enterprise packages can pass `oidcProviders` into `@objectstack/plugin-auth`
113113
or contribute them through `auth:configure`. The open-source package does not
114114
ship a generic OIDC settings UI.
115115

116+
> **Per-environment external IdP (ADR-0069).** Recent releases add a
117+
> per-environment external-IdP path built on `@better-auth/sso` (a generic OIDC
118+
> relying party) and surface an `sso` flag in the public `/auth/config`
119+
> (`features.sso`) so a client can show an enterprise-login button when SSO is
120+
> configured. The `oidcProviders` extension below remains the in-process path.
121+
116122
### Quick start — Okta
117123

118124
```ts

content/docs/guides/cloud-deployment.mdx

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -84,18 +84,11 @@ request — no restart, and no environment id to remember.
8484
> install in one call: `os package publish --env <id> --install`. This is for
8585
> automation only — interactive installs happen in the environment Marketplace.
8686
87-
> **Legacy env-revision path.** `os publish` posts compiled metadata straight to
88-
> an environment as a revision, rather than as a versioned package:
89-
>
90-
> ```bash
91-
> OS_CLOUD_URL=https://cloud.example.com OS_ENVIRONMENT_ID=env_prod os publish
92-
> # POST /api/v1/cloud/environments/:environment/metadata
93-
> # rollback: POST /api/v1/cloud/environments/:environment/revisions/:commit/activate
94-
> ```
95-
>
96-
> It still works, but the package flow above is the direction of travel
97-
> (ADR-0006 v4): `sys_environment_revision` is retired once all publishes go
98-
> through the package endpoints.
87+
> **Removed: the legacy env-revision path.** The direct-to-environment `os publish`
88+
> / `os rollback` commands (which wrote `sys_environment_revision`) were **removed**
89+
> (#2237, ADR-0006 v4). All publishing now goes through the package flow above
90+
> (`os package publish`); to change what an environment runs, install a package
91+
> version into it.
9992
10093
Cloud control-plane hosts, database provisioning, billing, and public SaaS
10194
deployment are outside this framework repository. The framework runtime exposes

content/docs/guides/data-modeling.mdx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,28 @@ enable: {
9797

9898
---
9999

100+
### Global search — `searchable` + `searchableFields`
101+
102+
`searchable: true` includes an object's records in global search and the record
103+
picker. By default the search matches the name/title field plus short-text fields.
104+
To control exactly which fields are matched, set `searchableFields` on the object
105+
(ADR-0061):
106+
107+
```typescript
108+
{
109+
name: 'account',
110+
searchable: true,
111+
searchableFields: ['name', 'website', 'billing_city'],
112+
}
113+
```
114+
115+
Queries then use the `$search` filter operator to match across `searchableFields`
116+
(e.g. `{ filters: { $search: 'acme' } }`); a view may narrow the set with
117+
`$searchFields`. When `searchableFields` is unset, search falls back to the
118+
name/title field plus short-text fields.
119+
120+
---
121+
100122
## Field Types & Configuration
101123

102124
### Text Fields

content/docs/guides/metadata/object.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ indexes: [
203203
| `active` | `boolean` | Is object active (default: `true`) |
204204
| `isSystem` | `boolean` | System object, protected from deletion (default: `false`) |
205205
| `abstract` | `boolean` | Abstract base, cannot be instantiated (default: `false`) |
206-
| `sharingModel` | `enum` | `'private'`, `'read'`, `'read_write'`, `'full'` |
206+
| `sharingModel` | `enum` | Org-Wide Default record visibility (ADR-0055/0056). Canonical: `'private'`, `'public_read'`, `'public_read_write'`, `'controlled_by_parent'` (detail visibility derived from its master). Legacy aliases: `'read'`=public_read, `'read_write'`/`'full'`=public_read_write |
207207
| `keyPrefix` | `string` | Short prefix for record IDs (e.g. `'001'`) |
208208
| `recordTypes` | `string[]` | Record type names for this object |
209209
| `validations` | `ValidationRule[]` | Object-level validation rules (see [Validation](./validation)) |

content/docs/guides/metadata/page.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ Components are the building blocks placed inside regions.
136136
| `events` | `Record<string, string>` | optional | Event handlers (action expressions) |
137137
| `style` | `object` | optional | CSS styles |
138138
| `className` | `string` | optional | CSS class names |
139+
| `responsiveStyles` | `object` | optional | **Preferred** SDUI styling channel (ADR-0065): per-breakpoint scoped CSS-property maps keyed by `xs`/`sm`/`md`/`lg`/`xl`/`2xl`, compiled to id-scoped CSS at render. Prefer design tokens, e.g. `{ base: { padding: 'var(--space-6)' }, md: { padding: 'var(--space-8)' } }`. Use over ad-hoc `style`/`className` for metadata-authored pages. |
139140
| `visibility` | `string` | optional | Visibility predicate (CEL expression) |
140141

141142
The `type` field is a union of the standard `PageComponentType` enum and any custom string. The standard (namespaced) component types include:

0 commit comments

Comments
 (0)