Skip to content

Commit d693ba1

Browse files
os-steveclaude
andauthored
docs(plugin-audit): restore the published README's services.audit pointer, in a form published readers can follow (#9589) (#9636)
PR #9531 dropped this README's "See Also" pointer to the runtime-services audit page because the page documented the settings sink (`record()` / `'set' | 'reset'`) as if it were the `audit` slot. PR #9587 rewrote the page around the real slot, so the omission's reason has stopped holding. Restored because the page carries three things this README deliberately does not: the slot's own failure posture (`recordAuthEvent` never throws; error once per process then debug; row lost, nothing retries; silent no-op with no engine or no `userId`), the event's field-by-field shape, and the settings-sink disambiguation with its `TypeError` consequence. The README's own slot section states the interface and the closed action union and stops there. The restored line is not the removed line. That one was labelled "Audit Logging Best Practices" — a guide the page has never been — and spelled `/content/docs/.../audit-service.mdx`, which resolves for neither audience a published README has: on npm and GitHub a root-relative href resolves against npmjs.com / github.com, not the docs site. The replacement uses the absolute `https://docs.objectstack.ai/docs/...` form that create-objectstack's published READMEs already use. The one pre-existing site-root-relative docs link in the same file is converted to the same absolute form; its page and heading anchor both exist, only the spelling was unfollowable off the docs site. Claude-Session: https://claude.ai/code/session_01XqDQYVU5smx29ts9pAErja Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
1 parent 40fb55e commit d693ba1

2 files changed

Lines changed: 52 additions & 1 deletion

File tree

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
"@objectstack/plugin-audit": patch
3+
---
4+
5+
Published README points at the `services.audit` reference again, in the form a published reader can follow (#9589)
6+
7+
PR #9531 dropped this README's "See Also" pointer to the runtime-services audit
8+
page because the page was measured wrong — it documented `record()` /
9+
`'set' | 'reset'` (the settings sink) as if that were the `audit` slot. PR #9587
10+
rewrote the page around the real slot, so the reason for the omission has stopped
11+
holding, and the link is restored.
12+
13+
It is restored because the page carries three things this README deliberately
14+
does not, each verified against the page as it stands on `main` rather than
15+
against the PR title that rewrote it:
16+
17+
- **the failure posture of the slot itself**`recordAuthEvent` never throws; a
18+
failed ledger insert is reported at `error` level once per process and then
19+
drops to `debug`, the row is lost and nothing retries it, and the call silently
20+
no-ops when no data engine resolves or when `userId` is absent. This README
21+
documents the *record-view batcher's* two failure postures, which are a
22+
different code path; it says nothing about this one.
23+
- **the event's field-by-field shape** — that `userId` must be a real `sys_user`
24+
id, that `sessionId` lands on `record_id` with `object_name` fixed to
25+
`sys_session`, that `organizationId` stamps the tenant columns and an unstamped
26+
row is one non-administrator members can never see, and that `context` is
27+
serialized into `metadata`. This README states the slot's interface and its
28+
closed `'login' | 'logout'` action union, and deliberately stops there.
29+
- **the settings-sink disambiguation** — that `SettingsAuditSink.record()` is
30+
never registered as or resolved from this slot, and that
31+
`getService('audit').record({ ... })` therefore fails with a `TypeError`.
32+
33+
The restored line is **not** the line #9531 removed. That one read
34+
`[Audit Logging Best Practices](/content/docs/kernel/runtime-services/audit-service.mdx)`
35+
— a label describing a best-practices guide the page has never been, and a
36+
repo-path-rooted URL that resolves for neither of this README's published
37+
audiences. A README in the package's `files` array is rendered on npm and on
38+
GitHub, where a root-relative href resolves against `npmjs.com` / `github.com`,
39+
not against the docs site. The replacement uses the absolute
40+
`https://docs.objectstack.ai/docs/...` form that `create-objectstack`'s published
41+
READMEs already use, and its annotation states what the page adds — so the next
42+
author weighing the same omission can check the justification instead of
43+
reconstructing it.
44+
45+
The one pre-existing site-root-relative docs link in this same file
46+
(`/docs/permissions/permission-sets#access-depth...`, added by the same PR) is
47+
converted to the same absolute form. Its target page and heading anchor both
48+
exist; only the spelling was unfollowable off the docs site.

packages/plugins/plugin-audit/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ Permission sets that use the **hierarchy-relative depth scopes** (`own_and_repor
340340
`@objectstack/security-enterprise`. The open edition ships no resolver, so those scopes
341341
**fail closed to `own`** — they never widen visibility without it. A grant written to let
342342
managers read their reports' audit rows will, on an open build, show them only their own.
343-
See [Access depth](/docs/permissions/permission-sets#access-depth--readscope--writescope-adr-0057-d1).
343+
See [Access depth](https://docs.objectstack.ai/docs/permissions/permission-sets#access-depth--readscope--writescope-adr-0057-d1).
344344

345345
`sys_comment`'s record-level edit gates resolve the `sharing` service lazily; without it
346346
those checks degrade to parent-record read visibility. If the engine exposes no middleware
@@ -394,3 +394,6 @@ Apache-2.0. See [LICENSING.md](../../../LICENSING.md).
394394

395395
- [@objectstack/plugin-security](../plugin-security/) — permissions, RLS and field-level security
396396
- [@objectstack/plugin-auth](../plugin-auth/) — the caller of the `audit` slot's auth-event ingress
397+
- [`services.audit` reference](https://docs.objectstack.ai/docs/kernel/runtime-services/audit-service) — the slot's
398+
full event shape, its never-throws failure posture, and why `SettingsAuditSink.record()`
399+
is not this slot

0 commit comments

Comments
 (0)