Skip to content

Commit 5b39fb5

Browse files
committed
test(plugin-security): one fact per negative pin so each is ablated on its own
Claude-Session: https://claude.ai/code/session_01XY5uCwTjZj7884yYtyur4H Co-authored-by: Claude <noreply@anthropic.com>
1 parent c60be71 commit 5b39fb5

1 file changed

Lines changed: 20 additions & 7 deletions

File tree

‎packages/plugins/plugin-security/src/orgless-position-name-fold.test.ts‎

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -271,12 +271,23 @@ describe('[#20555] with no active organization, another organization\'s set name
271271
expect(orgless.loaderRows.filter((row) => row.organization_id !== null)).toEqual([]);
272272
}, 120_000);
273273

274-
it('the authored sets\' capabilities and object map reach neither the resolved sets nor the effective map', async () => {
274+
// Three pins, one fact each, so the ablation shows each one fail on its own
275+
// rather than all three behind the first failed assertion.
276+
it('the authored sets are not among the resolved sets', async () => {
277+
const r = await rig();
278+
const orgless = await resolve(r, USER_HOME);
279+
expect(orgless.setNames.filter((n) => n === 'org_member' || n === 'everyone')).toEqual([]);
280+
}, 120_000);
281+
282+
it('their systemPermissions do not reach the principal', async () => {
275283
const r = await rig();
276284
const orgless = await resolve(r, USER_HOME);
277-
expect(orgless.setNames).not.toContain('org_member');
278-
expect(orgless.setNames).not.toContain('everyone');
279285
expect([...orgless.capabilities].filter((c) => c === 'manage_metadata' || c.startsWith('probe.'))).toEqual([]);
286+
}, 120_000);
287+
288+
it('their object map does not reach the effective map', async () => {
289+
const r = await rig();
290+
const orgless = await resolve(r, USER_HOME);
280291
expect(orgless.ledger).toBeNull();
281292
}, 120_000);
282293

@@ -285,7 +296,12 @@ describe('[#20555] with no active organization, another organization\'s set name
285296
const orgless = await resolve(r, USER_GLOBAL);
286297
expect(orgless.permissions).toContain('platform_ops');
287298
expect(orgless.byName.get('platform_ops')?.systemPermissions).toEqual(['probe.global_platform_ops']);
288-
expect(orgless.capabilities.has('probe.other_platform_ops')).toBe(false);
299+
}, 120_000);
300+
301+
it('…and the same-named copy\'s systemPermissions do not reach that principal', async () => {
302+
const r = await rig();
303+
const orgless = await resolve(r, USER_GLOBAL);
304+
expect([...orgless.capabilities].filter((c) => c.startsWith('probe.other_'))).toEqual([]);
289305
}, 120_000);
290306
});
291307

@@ -295,9 +311,6 @@ describe('[#20555] what the rule keeps', () => {
295311
const orgless = await resolve(r, USER_GLOBAL);
296312
expect(orgless.positions).toContain('ops_lead');
297313
expect(orgless.byName.get('ops_lead')?.systemPermissions).toEqual(['probe.global_ops_lead']);
298-
// …while the colliding names stay unresolved for this principal too.
299-
expect(orgless.setNames).not.toContain('org_member');
300-
expect(orgless.setNames).not.toContain('everyone');
301314
}, 120_000);
302315

303316
it('the global grants resolve identically with the principal\'s own organization active', async () => {

0 commit comments

Comments
 (0)