Skip to content

Commit e2b7669

Browse files
committed
chore(plugin-auth): anchor auth-manager-membership-admission.ts to ADR-0093
The membership reconciler's single assembly of its inputs, settleMembership, moved into auth-manager-membership-admission.ts in an earlier cut, but the ADR-0093 D2 invariant that governs it stayed anchored only on auth-manager.ts and auth-manager-database-hooks.ts. A new scripts/adr-anchors entry carries that paragraph verbatim for the module, and one comment-only paragraph in the module header names the decision, so check-adr-anchors can hold the reference there. No code changes. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LSXBc2GCBwiAL7vV4kWkyr
1 parent 7d3c013 commit e2b7669

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

‎packages/plugins/plugin-auth/src/auth-manager-membership-admission.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@
4545
* while they are first evaluated: this module's top level is imports, an
4646
* interface and function declarations.
4747
*
48+
* `settleMembership` below is governed by ADR-0093 D2: the membership
49+
* reconciler is the single owner of the "every user gets a membership"
50+
* invariant, and this is the manager's single assembly of its inputs, which
51+
* both creation seams call. `scripts/adr-anchors/` carries the invariant for
52+
* this file, as it does for `auth-manager.ts`.
53+
*
4854
* Nothing re-exports this module, so the published surface does not move.
4955
*/
5056

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"file": "packages/plugins/plugin-auth/src/auth-manager-membership-admission.ts",
3+
"adrs": [
4+
"ADR-0093"
5+
],
6+
"invariant": "ADR-0093 D2 — the membership reconciler is the SINGLE owner of the \"every user gets a membership\" invariant, and `settleMembership` is this manager's single assembly of its inputs. TWO seams call it and must never disagree: `user.create.after` (the creation seam every path flows through — email signup, admin create-user, bulk import, SSO JIT, none of which need a session) and `session.create.before` (which settles BEFORE resolving the session's active organization, so a user's first session is not minted tenant-less — #8245). Assembling the deps per call site would let them drift on the policy, which is a live platform setting read through `getMembershipPolicy()` (#5152): a captured option leaves one seam auto-binding after an admin switched the deployment to `invite-only`. The session-seam call must also stay a pure ORDERING change — same reconciler, same policy, same target-org resolution — so `invite-only` and multi-org still bind nobody and those sessions still mint with no active organization, which is the legal state the #8247 ruling declares."
7+
}

0 commit comments

Comments
 (0)