Skip to content

Commit f0f60a2

Browse files
committed
docs(site): full-corpus persona review — fix what real readers would hit
Seven reader-persona passes (first-time developer, schema modeler, logic author + API integrator, security admin, UI builder + AI admin, plugin developer, production SRE) read every hand-written page and verified claims against source before fixing. Highlights: - hooks: ctx.input is flat (installFlatInput) — the documented ctx.input.doc pattern never worked; fixed across hooks, events, error-handling-server, and the plugin tutorial - plugin tutorial: manifest example was missing required id (threw at parse) and registered a kernel hook name that never fires — a reader shipped a silently dead plugin; rewritten against engine.registerHook - permissions: removed the false implicit manager-visibility claim (role hierarchy grants nothing by itself); owner-type sharing rules and group/guest recipients marked declared-but-unenforced; FLS semantics corrected to default-visible for undeclared fields; no-sharingModel = no record filter warning added - data modeling: removed invented cdc/partitioning/recordTypes object config (schema hard-rejects), phantom field props (pruned 2026-06), wrong autonumber key; new expand (related records) query section - api: removed ADR-0019-deleted workflow approve/reject endpoints, invented webhook rate-limiting; realtime status stated honestly (in-process pub/sub; WS/SSE transport plugin-provided); error handling documents the two real wire formats - protocol: maskingRule/encryptionConfig sections re-scoped to their real status (System schemas exist; field wiring pruned, channel is type:'secret' + FLS) - deployment: env-var table repaired and completed (OS_SECRET_KEY, cluster vars), stale CLI paths and ten dead links fixed - onboarding: REST route /api/v1/data/:object, send_email→notify node, npx os pointers, nine dead ADR links - runtime-services: binding note — services.* is the contract surface; open-framework hooks use ctx.api / ctx.getService Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018r9mjpF7jr9BKdzEmUE4uZ
1 parent 8a3e5ca commit f0f60a2

62 files changed

Lines changed: 516 additions & 439 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

content/docs/ai/chatbot-integration.mdx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,13 @@ This guide maps every chatbot configuration knob to its framework endpoint
2626
so you can drop the plugin into an app without reverse-engineering the
2727
contract.
2828

29-
## 1. Enable the AI tier on the framework side
29+
## 1. Enable the AI tier on the backend
3030

31-
The `default` and `full` plugin tier presets both include the `ai`
32-
capability, so `objectstack dev` boots the AI services unless you opt out
33-
with `--preset minimal`. Provide a Vercel AI Gateway model and key via env
34-
vars:
31+
On a cloud / EE dev host (where `@objectstack/service-ai` is available —
32+
see the callout above), the `default` and `full` plugin tier presets both
33+
include the `ai` capability, so `objectstack dev` boots the AI services
34+
unless you opt out with `--preset minimal`. Provide a Vercel AI Gateway
35+
model and key via env vars:
3536

3637
```bash
3738
AI_GATEWAY_API_KEY=vck_*** \

content/docs/ai/knowledge-rag.mdx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ kernel.use(new KnowledgeMemoryPlugin());
4040
// kernel.use(new KnowledgeRagflowPlugin({ endpoint, apiKey }));
4141
```
4242

43-
Then register the AI tool so agents can call it:
43+
Then register the AI tool so agents can call it. (This step uses
44+
`@objectstack/service-ai`, i.e. the **cloud / Enterprise** in-UI AI runtime —
45+
see the callout in the [AI Overview](/docs/ai). The Knowledge Protocol itself
46+
and the adapter plugins above ship in the open framework.)
4447

4548
```ts
4649
import { registerKnowledgeTools } from '@objectstack/service-ai';

content/docs/api/client-sdk.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ The `@objectstack/client` SDK aims to implement the ObjectStack API protocol spe
122122
| **storage** || 2 | File upload & download |
123123
| **i18n** || 3 | Internationalization |
124124
| **notifications** | 🟡 | 7 | Legacy notification helpers; receipt/inbox cut-over pending |
125-
| **realtime** || 6 | WebSocket subscriptions |
125+
| **realtime** || 6 | Connection/subscription/presence calls (server transport is plugin-provided) |
126126
| **ai** || 3 | AI services (NLQ, suggest, insights) |
127127

128128
<Callout type="info">
@@ -553,18 +553,18 @@ For detailed information about the client's protocol implementation:
553553

554554
<Cards>
555555
<Card
556-
href="./api-reference"
557-
title="API Reference"
556+
href="/docs/api/data-api"
557+
title="Data API"
558558
description="Complete REST endpoint documentation"
559559
/>
560560
<Card
561-
href="./kernel-services"
561+
href="/docs/kernel/services-checklist"
562562
title="Kernel Services"
563563
description="Service checklist and plugin development guide"
564564
/>
565565
<Card
566-
href="../references/api/protocol"
566+
href="/docs/references/api/protocol"
567567
title="Protocol Types"
568-
description="All 57 Zod protocol schemas"
568+
description="The Zod protocol schemas"
569569
/>
570570
</Cards>

content/docs/api/environment-routing.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ const client = new ObjectStackClient({
7373

7474
const env = client.project('env_prod');
7575

76-
await env.data.find('customer', { top: 20 });
76+
await env.data.find('customer', { limit: 20 });
7777
await env.meta.getItems('object');
7878
await env.packages.list();
7979
```

content/docs/api/error-catalog.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Complete reference for all ObjectStack error codes with causes, fix
55

66
# Error Code Catalog
77

8-
ObjectStack uses a structured error system with **9 error categories** and **41+ standardized error codes**. Every error includes a machine-readable code, HTTP status mapping, and retry guidance.
8+
ObjectStack uses a structured error system with **9 error categories** and **51 standardized error codes**. Every error includes a machine-readable code, HTTP status mapping, and retry guidance.
99

1010
<Callout type="info">
1111
**Source:** `packages/spec/src/api/errors.zod.ts`
@@ -391,7 +391,7 @@ import type { EnhancedApiError } from '@objectstack/spec/api';
391391

392392
async function handleApiCall() {
393393
try {
394-
const result = await client.records.create('task', { title: 'New Task' });
394+
const result = await client.data.create('task', { title: 'New Task' });
395395
return result;
396396
} catch (error) {
397397
const apiError = error as EnhancedApiError;

content/docs/api/error-handling-client.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ description: Best practices for handling ObjectStack errors in client applicatio
88
This guide covers best practices for handling ObjectStack API errors in client applications — from parsing error responses to displaying validation errors in forms and implementing retry strategies.
99

1010
<Callout type="info">
11-
**Error Format:** All ObjectStack API errors follow the `ErrorResponseSchema` structure. See [Wire Format](/docs/api/wire-format#7-error-response-format) for the full JSON shape.
11+
**Error Format:** The patterns in this guide target the spec error envelope (`ErrorResponseSchema`). Note that today's kernel REST data routes emit a flatter `{ error, code }` shape — see the [API Overview](/docs/api#error-handling) for the two wire formats in use and [Wire Format](/docs/api/wire-format#7-error-response-format) for full JSON examples; adapt the parser accordingly.
1212
</Callout>
1313

1414
---

content/docs/api/error-handling-server.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ object (imported from `@objectstack/spec/data`) with `object`, `events`
7777
(an array of lifecycle events such as `beforeInsert` / `afterUpdate`), and a
7878
`handler: async (ctx) => { ... }`. Errors thrown from a hook handler abort the
7979
operation and propagate to the API layer. The handler receives a `HookContext`:
80-
the pending record lives on `ctx.input.doc`, the pre-change snapshot on
81-
`ctx.previous`, and the persisted result (after hooks) on `ctx.result`.
80+
the pending record's fields are exposed directly on `ctx.input`, the pre-change
81+
snapshot on `ctx.previous`, and the persisted result (after hooks) on `ctx.result`.
8282

8383
### Before Hooks (Validation / Guard)
8484

@@ -90,7 +90,7 @@ export const ValidateStatusTransition: Hook = {
9090
object: 'task',
9191
events: ['beforeUpdate'],
9292
handler: async (ctx) => {
93-
const changes = ctx.input.doc as Record<string, any>;
93+
const changes = ctx.input as Record<string, any>;
9494
const previous = ctx.previous ?? {};
9595

9696
// Guard: prevent modifying completed tasks
@@ -182,7 +182,7 @@ export const ValidateTaskData: Hook = {
182182
object: 'task',
183183
events: ['beforeInsert'],
184184
handler: async (ctx) => {
185-
const data = ctx.input.doc as Record<string, any>;
185+
const data = ctx.input as Record<string, any>;
186186
const schema = z.object({
187187
title: z.string().min(1, 'Title is required').max(200),
188188
priority: z.enum(['low', 'medium', 'high', 'critical']),
@@ -218,7 +218,7 @@ export const TaskWriteWithLogging: Hook = {
218218
onError: 'abort', // failure aborts the write (default); use 'log' to continue
219219
handler: async (ctx) => {
220220
try {
221-
await runBusinessRules(ctx.input.doc);
221+
await runBusinessRules(ctx.input);
222222
} catch (error) {
223223
const httpStatus = (error as AppError).httpStatus ?? 500;
224224
const logEntry = {
@@ -496,7 +496,7 @@ export const ValidateBusinessRules: Hook = {
496496
object: 'task',
497497
events: ['beforeInsert'],
498498
handler: async (ctx) => {
499-
const result = safeParsePretty(TaskBusinessRules, ctx.input.doc);
499+
const result = safeParsePretty(TaskBusinessRules, ctx.input);
500500
if (!result.success) {
501501
throw new AppError(
502502
'validation_error',

content/docs/api/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ObjectStack exposes a fully typed REST API. All endpoints use JSON request/respo
1414
| Surface | Status in this repo |
1515
| :--- | :--- |
1616
| **REST** | ✅ Auto-generated from the protocol (`@objectstack/rest`) — CRUD, query, batch, metadata, packages |
17-
| **Realtime** | ✅ WebSocket subscriptions plus SSE streaming (`@objectstack/service-realtime`) |
17+
| **Realtime** | ⚠️ In-process pub/sub service (`@objectstack/service-realtime`, single-instance); the `/realtime/*` REST routes and WebSocket/SSE transport are plugin-provided — none ships in the open framework |
1818
| **MCP** | ✅ Objects and opted-in actions exposed as Model Context Protocol tools ([AI module](/docs/ai)) |
1919
| **GraphQL** | ⚠️ Route is wired but **bring-your-own service**: `/graphql` returns 501 unless an implementation of the `IGraphQLService` contract is registered — none ships in the open framework |
2020
| **OData** | ⚠️ Vocabulary only: REST list endpoints accept OData-style operators (e.g. `$top`), but there is no standalone OData endpoint |

content/docs/api/plugin-endpoints.mdx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,16 @@ The following endpoints become available when the corresponding plugin is instal
3333
| GET | `/workflow/:object/config` | Get workflow configuration |
3434
| GET | `/workflow/:object/:recordId/state` | Get record's workflow state |
3535
| POST | `/workflow/:object/:recordId/transition` | Execute state transition |
36-
| POST | `/workflow/:object/:recordId/approve` | Approve workflow step |
37-
| POST | `/workflow/:object/:recordId/reject` | Reject workflow step |
36+
37+
Approve/reject are **not** workflow routes (ADR-0019): approval is a flow node, and decisions are recorded on the approvals runtime via `POST /approvals/requests/:id/approve` and `POST /approvals/requests/:id/reject`.
3838

3939
### Automation (`/automation`) — Plugin Required
4040

4141
| Method | Endpoint | Description |
4242
|:-------|:---------|:------------|
43-
| POST | `/automation/trigger/:name` | Trigger an automation flow by name |
43+
| POST | `/automation/:name/trigger` | Trigger an automation flow by name (legacy alias: `/automation/trigger/:name`) |
44+
45+
The automation dispatcher also exposes flow CRUD (`GET`/`POST /automation`, `GET`/`PUT`/`DELETE /automation/:name`) and run observability/resume routes — see [Durable pause & resume](/docs/automation/flows#durable-pause--resume-adr-0019).
4446

4547
### Views (`/ui`) — Plugin Required
4648

@@ -60,7 +62,7 @@ The following endpoints become available when the corresponding plugin is instal
6062
| POST | `/realtime/disconnect` | Close connection |
6163
| POST | `/realtime/subscribe` | Subscribe to channel |
6264
| POST | `/realtime/unsubscribe` | Unsubscribe |
63-
| POST | `/realtime/presence` | Set presence |
65+
| PUT | `/realtime/presence/:channel` | Set presence |
6466
| GET | `/realtime/presence/:channel` | Get channel presence |
6567

6668
### Notifications (`/notifications`) — Plugin Required

content/docs/automation/approvals.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,5 +130,5 @@ Separating *who configures* from *who approves* from *as whom it runs* is the sa
130130
## See also
131131

132132
- Decision records: **ADR-0049** (`runAs`), **ADR-0066** (unified authorization).
133-
- Guide: [Business Logic](/docs/automation/hooks) (Flows, Approval Nodes); [Who can see data / automation / interface](/docs/permissions/access-recipes).
133+
- Guide: [Hooks](/docs/automation/hooks) and [Flows](/docs/automation/flows); [Who can see data / automation / interface](/docs/permissions/access-recipes).
134134
- Reference: [Flow](/docs/references/automation/flow), [Approval](/docs/references/automation/approval).

0 commit comments

Comments
 (0)