Skip to content

Commit 97f5296

Browse files
committed
test(dogfood): the legacy criteria-less rule belongs to the install's organization, now that 7a-3 reads own-organization rules only
Claude-Session: https://claude.ai/code/session_018EszgtA3V2KXBX5tf59Hi4 Co-authored-by: Claude <noreply@anthropic.com>
1 parent 5a321e3 commit 97f5296

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

‎packages/qa/dogfood/test/sharing-rule-criteria-required.dogfood.test.ts‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import { describe, it, expect, beforeAll, afterAll } from 'vitest';
2626
import { type VerifyStack } from '@objectstack/verify';
2727
import { bootShowcase } from './showcase-boot.js';
28-
import { relaxTenantColumns } from './pre-18-tenant-column.testkit.js';
2928

3029
// Sharing-rule routes are anchored on the API base, not under `/data/:object`
3130
// (they administer rules tenant-wide) — `/api/v1/sharing/rules`.
@@ -138,11 +137,13 @@ describe('#3896 — a sharing rule POSTed without criteria is rejected, never ma
138137
const id = 'srule_3896_legacy';
139138
const driver = (ql as any).getDriverForObject('sys_sharing_rule');
140139
expect(driver, 'sys_sharing_rule driver must be resolvable').toBeTruthy();
141-
// That residue lives only on a store built before 18.x, whose tenant column is
142-
// nullable (ADR-0131 D1 makes a fresh one NOT NULL): the table is that store's.
143-
await relaxTenantColumns(ql as any, ['sys_sharing_rule']);
140+
// The legacy row belongs to the install's organization, as every row does
141+
// since the ownership ceremony (ADR-0131 D1): its missing criteria is the
142+
// subject here, not its owner.
143+
const [organization] = (await ql.find('sys_organization', { context: SYS })) as Array<{ id: string }>;
144144
await driver.create('sys_sharing_rule', {
145145
id,
146+
organization_id: organization.id,
146147
name: 'legacy_match_all_3896',
147148
label: 'Legacy match-all',
148149
object_name: OBJECT,

0 commit comments

Comments
 (0)