Repository navigation
Commit 5f4a3f0
test(plugin-security,plugin-auth,plugin-approvals): narrow the blanket pre-18 tenant-column relax rigs to the tables they write organization-less (#25327)
<!-- claude-projects-attribution: {"github_login":"os-sales"} -->
_Requested by **Sales** · [project
thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4Uu9Kz1GpzqNbccvHKqWUx39Y)_
Fixes #25132
Clause-②: no
Metadata-protocol: none
Why `Clause-②: no`: test files only. No source, no export, no schema and
no published file changes (the three packages ship `dist`, `README.md`
and `CHANGELOG.md`), so no changeset either.
## What changed
Every blanket `relaxEveryRegisteredTenantColumn(engine)` /
`relaxEveryTenantColumn(engine, objects)` call in `plugin-security`,
`plugin-auth` and `plugin-approvals` tests now names the tables its rig
writes organization-less, through the testkit's existing
`relaxTenantColumns(engine, tables)`. On this base there were 41 call
sites in 38 files. The card counted 47 occurrences in 40 files on
`4e2c42f363`, a count that also matched the testkits' own definitions.
- 39 sites name their tables. Most need one table (`sys_permission_set`
is the common one). The widest is `catalog-reference-report` with four.
- 2 sites wrote no organization-less row at all, so their relax and its
comment are gone: `controlled-by-parent-chain-middle-master.test.ts` and
the `bootSharing` rig in `explain-enforce-parity.test.ts`.
- The generic comment `The organization-less rows below (global sets,
positions, grants) exist only…` (and its two siblings) named row kinds
most rigs do not seed. It now reads `The organization-less rows below
exist only on a store built before 18.x (ADR-0131 D1 makes a fresh
tenant column NOT NULL): this is that store.` Rig-specific comments are
kept as they were.
- With no caller left, the blanket exports leave the three packages'
`pre-18-tenant-column.testkit.ts`. `relaxTenantColumns`' doc gains one
sentence on why a suite names only its own tables.
`packages/qa/dogfood/test/pre-18-tenant-column.testkit.ts` keeps its own
copy and callers; it is outside this card.
## How the lists were measured
The lists were measured, not read off the code. A temporary probe (never
committed) wrapped the blanket form: after relaxing, it put an `AFTER
INSERT` / `AFTER UPDATE` trigger on each relaxed table. The trigger
fired when a row landed with `organization_id` NULL and logged the
table, the test and the call site. All 38 files ran with the probe in
place: plugin-security 27 files / 641 tests, plugin-auth 9 / 96 (10
skipped), plugin-approvals 2 / 18. Each site's list is the union of the
tables that fired under it.
Every logged row was then traced to the test's own writes. Each row's id
is either a literal in the test file, or comes from a write the test
itself makes through the engine as a case's subject. Examples are "a
writer with no active organization stores an organization-less row" and
"the `single` posture … an emptied organization is admitted". No table
on any list is there only because of an unstamped side write from
production code.
## Verification (on `c4a6f34b`)
- **Sufficient:** the 38 files pass with the named lists:
plugin-security 27 files / 641 tests, plugin-auth 9 / 96 (10 skipped),
plugin-approvals 2 / 18.
- **Each named table is needed (the card's spot check, on every rig):**
for each of the 58 named entries, that one table was dropped from its
list on disk, the file was run, and the file was restored from `HEAD`
(each restore checked with `git diff --quiet HEAD`). All 58 runs went
red. Each one failed only on `NOT NULL constraint failed:
TABLE.organization_id` for the dropped table. For the per-test
`qa_parity_deal_*` objects of `bootRls`, it failed only on that family.
- Full suites: `pnpm --filter @objectstack/plugin-approvals --filter
@objectstack/plugin-auth run test`: 94 files / 1213 tests and 187 files
/ 3525 tests (10 skipped), exit 0. plugin-security: see the report.
- `typecheck` for all three packages, including `check:test-typecheck`,
exits 0. The test-typecheck debt ledgers are unchanged.
- The `driver-fault-auth-log-carriers` Postgres and MySQL cells skip
here because their URLs are unset. Their seeds are the same code as the
SQLite cell, which measured `sys_permission_set` alone.
Branch: the harness-assigned `claude/project-thread-wxw16a`, not the
repo-convention `claude/issue-25132-…` (Duplicate Fix Guard).
## Acceptance notes
- `last-admin-guard.anchor-parity` models "a tenant column NOT NULL
nowhere" (a pre-18 store, or a driver that enforces no NOT NULL). It now
relaxes only `sys_user_permission_set`, the grant table its
organization-less row lives in. Its comment says "a grant tenant
column".
---
_Generated by [Claude
Code](https://claude.ai/code/session_014aRYTwvuSQoDgWzLdw1nc9)_
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_014aRYTwvuSQoDgWzLdw1nc9
Co-authored-by: Claude <noreply@anthropic.com>1 parent 67ab712 commit 5f4a3f0
41 files changed
Lines changed: 148 additions & 253 deletions
File tree
- packages/plugins
- plugin-approvals/src
- plugin-auth/src
- plugin-security/src
- objects
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| |||
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
193 | 192 | | |
194 | 193 | | |
195 | 194 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
| 79 | + | |
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| |||
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
221 | 220 | | |
222 | 221 | | |
223 | 222 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
14 | 17 | | |
15 | 18 | | |
16 | 19 | | |
| |||
28 | 31 | | |
29 | 32 | | |
30 | 33 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
113 | 112 | | |
114 | 113 | | |
115 | 114 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| |||
253 | 253 | | |
254 | 254 | | |
255 | 255 | | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
260 | 259 | | |
261 | 260 | | |
262 | 261 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
142 | 141 | | |
143 | 142 | | |
144 | 143 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
121 | 120 | | |
122 | 121 | | |
123 | 122 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| |||
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
227 | | - | |
| 227 | + | |
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
14 | 17 | | |
15 | 18 | | |
16 | 19 | | |
| |||
28 | 31 | | |
29 | 32 | | |
30 | 33 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
0 commit comments