Skip to content

Commit 87d9458

Browse files
docs(audit): drop organization_id from the record-view row columns (#31788)
<!-- claude-projects-attribution: {"github_login":"os-steve"} --> _Requested by **Steve** · [project thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9TAmgWWmAcmEVrHtnyoKy19)_ Fixes #31760 Clause-②: no Metadata-protocol: none ## 维护者速读 - 改了什么:记录查看审计文档页的列表格删掉了不存在的 `organization_id` 列,只留 `tenant_id`,并加一句说明原因。 - 为什么改:`sys_audit_log` 声明了 `systemFields: { tenant: false }`,查看审计的写入方也只写 `tenant_id`;文档照着它找列会扑空。 - 风险与回滚:纯文档,不动 spec 与运行时;回滚就是 revert 这一笔提交。 - 先看:`content/docs/permissions/record-view-auditing.mdx` 的「What a view row records」表格及其下方新加的一段。 - 两分钟验证:`git grep -n "organization_id" content/docs/permissions/record-view-auditing.mdx`,预期只剩新加说明句里的那一处。 - 需要你做的:无,席位落地。 ## What changes `content/docs/permissions/record-view-auditing.mdx`, the "What a view row records" table: - The row `tenant_id` / `organization_id` becomes `tenant_id` alone. - One new paragraph under the table: a view row has no `organization_id` column because `sys_audit_log` declares `systemFields: { tenant: false }`, so no organization column is injected, and `tenant_id` records the organization the viewed record belongs to. No spec or runtime change. The spec and the runtime already agree with each other; the doc page is the side that drifted. Step-0 readings, on `origin/main` at `c2bb879f`: | Where | Reading | | --- | --- | | Doc table | `record-view-auditing.mdx:169` listed `tenant_id` / `organization_id` | | Object | `packages/plugins/plugin-audit/src/objects/sys-audit-log.object.ts:91` declares `systemFields: { tenant: false }` (the card cites line 31; the declaration sits at 91 on this tree) | | Writer | `packages/plugins/plugin-audit/src/read-audit.ts:600` `buildRow` writes `action`, `created_at`, `user_id`, `object_name`, `record_id`, `old_value`, `new_value`, `tenant_id`, plus `actor` when the column exists. No `organization_id`. | A repo-wide sweep of `content/docs/` found no other page that names `organization_id` as a column of `sys_audit_log`, so this page is the only edit. Forced test changes: none. ## Tests Docs only: no package source changed, so there is no package test, typecheck, build closure or ablation leg owed. ## Acceptance notes - Changeset: none. The diff touches only `content/docs/**`, which no package's `files[]` ships, so it publishes nothing and carries `skip-changeset`. - `pnpm lint`: no package touched, so no per-package lint run is owed. ## Verification <details><summary>Derived gates at head 090ad31: 45 derived, 45 run, all exit 0</summary> `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` derived 45 commands for the one path. Prerequisite build under the lock: `turbo run build` of `@objectstack/client-react...`, `@objectstack/spec`, `@objectstack/lint...` (VERDICT command-exit 0). Every one of the 45 commands then exited 0, and the `--ran` reconciliation printed: 45 derived famil(ies) accounted for, 45 run, 0 NOT-MEASURED, 0 UNRUN. Families outside the derived set (artifact rosters, wide-population families, type-check lanes, the path-scheduled Plan Test Core shards job) are CI's: see this PR's check-runs. </details> --- _Generated by [Claude Code](https://claude.ai/code/session_01ADHkmSV2pebMMqfiV9MfHr)_ Co-authored-by: Claude <noreply@anthropic.com>
1 parent 2b752aa commit 87d9458

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎content/docs/permissions/record-view-auditing.mdx‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,13 @@ should read this as "record-detail views", not "reads".
166166
| `actor` | The principal label, falling back to `user_id` (stamped only where the column exists) |
167167
| `object_name` | The object whose record was opened |
168168
| `record_id` | The record's id |
169-
| `tenant_id` / `organization_id` | The **viewed record's** own organization, falling back to the viewer's session organization |
169+
| `tenant_id` | The **viewed record's** own organization, falling back to the viewer's session organization |
170170
| `old_value` / `new_value` | Always `null` — see below |
171171

172+
A view row has no `organization_id` column: `sys_audit_log` declares
173+
`systemFields: { tenant: false }`, so no organization column is injected, and
174+
`tenant_id` records the organization the viewed record belongs to.
175+
172176
The tenant stamp comes from the record rather than the viewer deliberately: a
173177
row about an org-A record stamped with the viewer's active org B would land
174178
behind org B's tenant wall, invisible to the one tenant administrator the row

0 commit comments

Comments
 (0)