Skip to content

Commit 16770e8

Browse files
committed
refactor(plugin-auth): move AuthManager's password, auth-gate and session policy bodies into auth-manager-password-session-policy.ts
Twelve method bodies (ADR-0069 D1/D2/D3/D4 and the per-user gate posture) move unedited; the class keeps each method, its docblock and signature, and hands each body the members it reads. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LSXBc2GCBwiAL7vV4kWkyr
1 parent 5f4a3f0 commit 16770e8

5 files changed

Lines changed: 731 additions & 481 deletions

File tree

‎content/docs/permissions/tenant-audit-census.mdx‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ what moved this page's population from 225 to 227; nothing about the two sites
9393
changed, only whether this instrument could see them.
9494

9595
**The expensive failure direction is a keyword.** Sites whose receiver the author
96-
typed `any` have no type to read, and there are 44 of them — just under a fifth
96+
typed `any` have no type to read, and there are 52 of them — just over a fifth
9797
of the population, concentrated in exactly the seed and bootstrap paths this
9898
control exists for. Scoring an unreadable receiver as "not an engine" would have
9999
dropped every one of them silently, with a clean exit and a smaller number that
@@ -210,7 +210,7 @@ be stated is what this instrument counts, which is written above and re-runnable
210210
at any commit.
211211

212212
Two structural facts do plausibly widen this reading against any hand or regex
213-
one, and both are counted in the generated tables below: the 44 sites reached
213+
one, and both are counted in the generated tables below: the 52 sites reached
214214
through an erased (`any`) receiver, and the 51 that name their object through a
215215
`const` rather than inline. An instrument that read either the way a person does
216216
would report a smaller number and would not say so.
@@ -249,8 +249,8 @@ cannot read, and they are neither in nor out.
249249

250250
| how the instrument reached the site | count |
251251
| :--- | ---: |
252-
| receiver carried a readable engine type | 193 |
253-
| receiver erased, placed by the object NAME | 34 |
252+
| receiver carried a readable engine type | 185 |
253+
| receiver erased, placed by the object NAME | 42 |
254254
| receiver erased, placed by an `object: string` PARAMETER | 5 |
255255
| receiver erased, placed by an `UNTYPED_RECEIVERS` row | 5 |
256256

@@ -307,13 +307,13 @@ holds still. They are required to be HERE and to say WHEN they were true;
307307
their values are not compared. The reasoning, and the measurement behind it,
308308
are in `scripts/check-tenant-audit-census.mjs`.
309309

310-
Measured on 2026-10-22 at `75983184c`.
310+
Measured on 2026-10-23 at `5f4a3f088`.
311311

312312
| corpus scale (not enforced) | count |
313313
| :--- | ---: |
314-
| tracked non-test sources scanned | 708 |
314+
| tracked non-test sources scanned | 712 |
315315
| engine-shaped types recognised | 87 |
316316
| declared objects in the registry | 117 |
317-
| same-named calls subtracted as non-engine | 171 |
317+
| same-named calls subtracted as non-engine | 172 |
318318

319319
{/* END GENERATED: tenant-audit-census */}

‎docs/audits/2026-08-tenant-audit-write-call-sites.counts.md‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,14 @@ holds still. They are required to be HERE and to say WHEN they were true;
9090
their values are not compared. The reasoning, and the measurement behind it,
9191
are in `scripts/check-tenant-audit-census.mjs`.
9292

93-
Measured on 2026-10-22 at `75983184c`.
93+
Measured on 2026-10-23 at `5f4a3f088`.
9494

9595
| corpus scale (not enforced) | count |
9696
| :--- | ---: |
97-
| tracked non-test sources scanned | 708 |
97+
| tracked non-test sources scanned | 712 |
9898
| engine-shaped types recognised | 87 |
9999
| declared objects in the registry | 117 |
100-
| same-named calls subtracted as non-engine | 171 |
100+
| same-named calls subtracted as non-engine | 172 |
101101

102102
## Every site
103103

@@ -130,11 +130,12 @@ Measured on 2026-10-22 at `75983184c`.
130130
| `packages/plugins/plugin-auth/src/admin-user-endpoints.ts` | `update` | `sys_user` | enabled | elevated | 1 |
131131
| `packages/plugins/plugin-auth/src/adopt-membership.ts` | `update` | `SystemObjectName.MEMBER` | undecidable | PROVABLY NONE | 1 |
132132
| `packages/plugins/plugin-auth/src/audience-gate-test-support.ts` | `insert` | `sys_invitation` | enabled | elevated | 1 |
133+
| `packages/plugins/plugin-auth/src/auth-manager-password-session-policy.ts` | `update` | `sys_account` | enabled | options unreadable | 1 |
134+
| `packages/plugins/plugin-auth/src/auth-manager-password-session-policy.ts` | `update` | `sys_session` | enabled | options unreadable | 3 |
135+
| `packages/plugins/plugin-auth/src/auth-manager-password-session-policy.ts` | `update` | `sys_two_factor` | enabled | options unreadable | 1 |
136+
| `packages/plugins/plugin-auth/src/auth-manager-password-session-policy.ts` | `update` | `sys_user` | enabled | options unreadable | 3 |
133137
| `packages/plugins/plugin-auth/src/auth-manager-sign-in-lockout.ts` | `update` | `sys_user` | enabled | options unreadable | 3 |
134-
| `packages/plugins/plugin-auth/src/auth-manager.ts` | `update` | `sys_account` | enabled | options unreadable | 1 |
135-
| `packages/plugins/plugin-auth/src/auth-manager.ts` | `update` | `sys_session` | enabled | options unreadable | 3 |
136-
| `packages/plugins/plugin-auth/src/auth-manager.ts` | `update` | `sys_two_factor` | enabled | options unreadable | 1 |
137-
| `packages/plugins/plugin-auth/src/auth-manager.ts` | `update` | `sys_user` | enabled | options unreadable | 5 |
138+
| `packages/plugins/plugin-auth/src/auth-manager.ts` | `update` | `sys_user` | enabled | options unreadable | 2 |
138139
| `packages/plugins/plugin-auth/src/auth-manager.ts` | `insert` | `sys_user_permission_set` | enabled | elevated | 1 |
139140
| `packages/plugins/plugin-auth/src/auth-manager.ts` | `delete` | `sys_verification` | enabled | elevated | 1 |
140141
| `packages/plugins/plugin-auth/src/auth-manager.ts` | `insert` | `sys_verification` | enabled | elevated | 1 |

‎packages/plugins/plugin-auth/src/api-error-code.pin.test.ts‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,12 @@ describe('every new APIError( in plugin-auth/src carries an ADR-0112 code (#2424
175175
// throw does not have to edit this line; only losing them does.
176176
// [#25224] `AuthManager`'s throws are counted over the files its methods'
177177
// bodies live in: `auth-manager.ts` and the bodies moved out of it whole.
178-
const authManagerFiles = ['auth-manager.ts', 'auth-manager-actor-guards.ts', 'auth-manager-sign-in-lockout.ts'];
178+
const authManagerFiles = [
179+
'auth-manager.ts',
180+
'auth-manager-actor-guards.ts',
181+
'auth-manager-sign-in-lockout.ts',
182+
'auth-manager-password-session-policy.ts',
183+
];
179184
expect(sites.length).toBeGreaterThanOrEqual(30);
180185
expect(new Set(sites.map((s) => s.file)).size).toBeGreaterThanOrEqual(4);
181186
expect(perFile.filter((f) => authManagerFiles.includes(f.file)).reduce((n, f) => n + f.sites.length, 0)).toBeGreaterThanOrEqual(24);

0 commit comments

Comments
 (0)