Skip to content

Commit ffffab1

Browse files
committed
test(dogfood): the open-posture invitee in the walled census holds the declared set on its first membership
The walled organization census pinned the removed branch: an invitee under the open posture was admitted by its invitation and owed no declared set. Under the ruled rule the posture admits it, invitation or not, so its declared grant settles on its first membership, the organization whose invitation it accepted. Found by the dogfood battery the ! title owes. Claude-Session: https://claude.ai/code/session_01FEkQ5pb2t8Z8C64PkPyVt1 Co-authored-by: Claude <noreply@anthropic.com>
1 parent 0ef10da commit ffffab1

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

‎packages/qa/dogfood/test/signup-organization-census-walled.dogfood.test.ts‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616
// - the self-registration grant (`sys_user_permission_set`) settles on the
1717
// self-registrant's FIRST MEMBERSHIP, owned by that membership's
1818
// organization (ADR-0131 D3) — never at sign-up, when there is no
19-
// organization yet; the invitee is admitted by the invitation, not by the
20-
// open posture, and is owed no declared set;
19+
// organization yet; the invitee is admitted by the open posture,
20+
// invitation or not, so its declared set settles on its first membership
21+
// too, the organization whose invitation it accepted;
2122
// - the activity writer (`sys_activity`) stamps the organization of the
2223
// record it is about, and writes NO row about a record that has none
2324
// (ADR-0131 D9; ruling of record 6257510973 item 3, Q3 A);
@@ -212,11 +213,13 @@ for (const posture of ['group', 'isolated'] as const) {
212213
// The creator's `organization_admin` (the auto org-admin grant) rides
213214
// the same membership; every grant names the organization.
214215
expect(grants.filter((g: Row) => g.organization_id !== orgId), 'grants outside the organization').toEqual([]);
215-
// The invitee was admitted by the invitation, not by the open posture, so
216-
// is owed no declared set (`decideAudienceAdmission`); whatever it holds
217-
// names the organization too.
216+
// The open posture admits the invitee by its own rule, invitation or not,
217+
// so it is owed the declared set like the registrant
218+
// (`decideAudienceAdmission`); the grant settles on its first membership,
219+
// the organization whose invitation it accepted, and every grant it
220+
// holds names that organization.
218221
const inviteeGrants = await ql.find('sys_user_permission_set', { where: { user_id: inviteeId }, ...SYS });
219-
expect(inviteeGrants.filter((g: Row) => g.permission_set === SET), 'the invitee holds no declared grant').toEqual([]);
222+
expect(inviteeGrants.filter((g: Row) => g.permission_set === SET).map((g: Row) => g.organization_id), 'the invitee\'s declared grant').toEqual([orgId]);
220223
expect(inviteeGrants.filter((g: Row) => g.organization_id !== orgId), 'invitee grants outside the organization').toEqual([]);
221224
});
222225

0 commit comments

Comments
 (0)