You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 8111c0d
Browse filesBrowse the repository at this point in the historyBrowse files
docs(skills): name the two driver-layer tenantId symbols in the two-axes note
Contract review should-fixes on the save-notice rows: the two-axes note in
references/data-hooks.md now carries execCtx.tenantId / DriverOptions.tenantId,
which the deleted blockquote had named; paid by the session.roles history
clause and two bytes of punctuation in the new rows. The ratchet row comment
states the net move instead of per-piece counts.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9qibx4SVi1CLmwbLz82b7
Copy file name to clipboardExpand all lines: skills/objectstack-data/references/data-hooks.md
+5-4Lines changed: 5 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -358,13 +358,13 @@ The sandbox is handed a **JSON snapshot** of these (built by
358
358
|`ctx.previous`| object \|`undefined`| Pre-write record on update/delete. **`undefined` on insert** → use `!ctx.previous` to detect *create*. |
359
359
|`ctx.result`| object \|`undefined`|`after*` only. ⚠️ **partial** on afterUpdate — see gotcha 1. |
360
360
|`ctx.user`| object \|`undefined`|`{ id, name, email, organizationId }`. `undefined` for system / unauthenticated writes. |
361
-
|`ctx.session`| object \|`undefined`|`{ userId, organizationId, isSystem, … }`. **No role list** — `session.roles` was retired in 17.0.0: it was declared but never produced, so every read was `undefined`. |
361
+
|`ctx.session`| object \|`undefined`|`{ userId, organizationId, isSystem, … }`. **No role list** — `session.roles` was retired in 17.0.0 (declared, never produced). |
362
362
|`ctx.event`| string | e.g. `'afterUpdate'` — dispatch on it when one hook subscribes to several events. |
363
363
|`ctx.object`| string | The target object name. |
364
364
|`ctx.api`| object | Cross-object CRUD. Gated by `api.read` / `api.write` — see below. |
365
365
|`ctx.log`|`{ debug, info, warn, error }`| Gated by `log`. Call **`ctx.log.info(msg, data?)`** — `ctx.log` is an **object, not** callable as `ctx.log(msg)`. Emission is **best-effort** (see Troubleshooting). |
366
366
|`ctx.crypto`|`{ randomUUID }`| Gated by `crypto.uuid`. |
367
-
|`ctx.notice`|`(message) => void`|**Tell the saver what this save set in motion** — answered as the create/update `notice`, shown on the save toast. No capability; insert/update only; last call wins. Rules: [`rules/lifecycle.md` § Save Notice](../rules/lifecycle.md#save-notice). |
367
+
|`ctx.notice`|`(message) => void`|**Tell the saver what this save set in motion** — answered as the create/update `notice`, shown on the save toast. No capability; insert/update only; last call wins. [`rules/lifecycle.md` § Save Notice](../rules/lifecycle.md#save-notice). |
368
368
|`ctx.title`|`(field?) => Promise<string \| null>`|**Name the record, not its id.**`ctx.title()` resolves this object's `nameField`, a **formula** included (no extra read); `ctx.title('account_id')` resolves a lookup's title (needs `api.read`). `null` when there is no title, never the id. **Per door:**`body` has it; a deprecated `handler` gets it at runtime, undeclared on `HookContext` (TS2339 when annotated) — use `body`; `ql.registerHook` and a bare `ObjectQL``bindHooks` lack it. |
369
369
370
370
(Action bodies additionally receive `ctx.recordId` and `ctx.record`, and their
@@ -598,7 +598,7 @@ interface HookContext {
598
598
// Engine access
599
599
ql:IDataEngine; // ObjectQL engine instance
600
600
api?:ScopedContext; // Cross-object CRUD API
601
-
notice?: (message:string) =>void; // Save notice — rules/lifecycle.md § Save Notice
601
+
notice?: (message:string) =>void; // Save notice: rules/lifecycle.md § Save Notice
602
602
603
603
// User info shortcut (undefined for system / unauthenticated writes)
0 commit comments