Skip to content

Commit 9fd0ebf

Browse files
committed
docs(plugin-auth): re-anchor the dead tracker citations to the commits that decided them
Comment and docblock prose under packages/plugins/plugin-auth/src only. Each site that cited a tracker number answering 404 now cites the commit in this repository's history that decided what the line describes, and says in its own words what that commit decided. 95 sites on 95 lines in 31 files, 16 numbers, 15 anchor commits; 12 further lines are reflow or a lost referent. No code token moves; every file keeps its line count. Claude-Session: https://claude.ai/code/session_01XY5uCwTjZj7884yYtyur4H Co-authored-by: Claude <noreply@anthropic.com>
1 parent b80ab57 commit 9fd0ebf

31 files changed

Lines changed: 107 additions & 107 deletions

‎packages/plugins/plugin-auth/src/account-identity-preflight.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* declaration without the constraint. That population is real and reachable:
1919
* `syncDeclaredIndexes` logs a plain UNIQUE whose CREATE fails on existing
2020
* duplicates onto the durability channel and lets the boot continue
21-
* (#14902 / #15479), deliberately, so one dirty table cannot take a deployment
21+
* (commit 61821e54c / #15479), deliberately, so one dirty table cannot take a deployment
2222
* down. `SYS_ACCOUNT_NO_UNIQUE` below is that deployment, spelled as a fixture
2323
* — the same shape with the unique index absent.
2424
*
@@ -51,7 +51,7 @@ const SYSTEM = { context: { isSystem: true } } as never;
5151

5252
/**
5353
* `sys_account` as a deployment whose declared `(provider_id, account_id)`
54-
* UNIQUE was never physically created — the #14902 / #15479 population. Only
54+
* UNIQUE was never physically created — the commit 61821e54c / #15479 population. Only
5555
* the columns the probe reads are spelled.
5656
*/
5757
const SYS_ACCOUNT_NO_UNIQUE = {

‎packages/plugins/plugin-auth/src/account-identity-preflight.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import { keysetWalk } from '@objectstack/types';
3131
*
3232
* ⚠️ "Declared" is not "present". `syncDeclaredIndexes` logs a plain UNIQUE
3333
* whose CREATE fails on existing duplicates onto the durability channel and
34-
* lets the boot continue (#14902 / #15479) — deliberately, so one dirty table
34+
* lets the boot continue (commit 61821e54c / #15479) — deliberately, so one dirty table
3535
* cannot take a deployment down. A database that ever held duplicates therefore
3636
* carries the declaration and not the constraint, and can still hold the class
3737
* today.

‎packages/plugins/plugin-auth/src/admin-has-permission-endpoint.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
* who is a platform admin under ADR-0068 (`isPlatformAdminUser`, the same
2727
* predicate every shaded `/admin/*` mount trusts) sending a body the vendor's
2828
* own handler would EVALUATE. Every other caller and every other body shape
29-
* is DELEGATED through `AuthManager.handleRequest` — the #12029 gate-then-
29+
* is DELEGATED through `AuthManager.handleRequest` — commit 6dd3e6968's gate-then-
3030
* delegate seam — so the vendor's native bytes stand: an anonymous caller
3131
* still gets the enveloped 401, a plain member still gets its own
3232
* `200 {"error":null,"success":false}` negative (pinned by the non-admin

‎packages/plugins/plugin-auth/src/admin-remove-user-gate-ordering.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
22
//
3-
// #11477 — ORDERING PIN: on `/admin/remove-user` the break-glass guard must run
3+
// commit 6dd3e6968 — ORDERING PIN: on `/admin/remove-user` the break-glass guard must run
44
// AFTER authorization, and the whole `/admin/*` family must agree on that order.
55
//
66
// ── The defect this pins, and why a pin is half the fix ─────────────────────

‎packages/plugins/plugin-auth/src/auth-email-locale.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* caller's own `Accept-Language` first (only when it names a locale in
99
* `AUTH_EMAIL_TEMPLATE_LOCALES`), and the deployment default second. The
1010
* 2026-08-13 ruling had made the deployment default the whole answer and
11-
* rejected `Accept-Language` outright. #14762 then added the rung ABOVE both,
11+
* rejected `Accept-Language` outright. Commit 35e94c96b then added the rung ABOVE both,
1212
* per the #14788 option-D ruling of 2026-09-03: the recipient's own
1313
* `sys_user.locale` (#13881) when the account holds one.
1414
*
@@ -479,7 +479,7 @@ describe('#14319 — authEmailLocaleFromRequest', () => {
479479
});
480480
});
481481

482-
// ── #14762 — the stored rung ───────────────────────────────────────────────
482+
// ── commit 35e94c96b — the stored rung ─────────────────────────────────────
483483

484484
/**
485485
* #14788 was ruled option D on 2026-09-03 (maintainer verbatim 「同意」):

‎packages/plugins/plugin-auth/src/auth-manager.test.ts‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1553,7 +1553,7 @@ describe('AuthManager', () => {
15531553
});
15541554
});
15551555

1556-
// #10366 — the localhost-wildcard trio is a DEVELOPMENT convenience and is
1556+
// commit bbe643c08 — the localhost-wildcard trio is a DEVELOPMENT convenience and is
15571557
// gated on `NODE_ENV !== 'production'`. Before the gate the condition tested
15581558
// only emptiness, so a production deployment whose trusted-origin list
15591559
// resolved empty silently CSRF-trusted every `localhost` / `*.localhost`
@@ -2530,7 +2530,7 @@ describe('AuthManager', () => {
25302530
expect(sms.sent[0].body).toContain('verification code');
25312531
});
25322532

2533-
// ── #14762 — the recipient's own `sys_user.locale` as the top rung ──────
2533+
// ── commit 35e94c96b — the recipient's own `sys_user.locale` as the top rung
25342534
//
25352535
// #14788 was ruled option D on 2026-09-03: `sys_user.locale` when set →
25362536
// the request's `Accept-Language` → the deployment default. There is no
@@ -2651,7 +2651,7 @@ describe('AuthManager', () => {
26512651

26522652
// ── #14641 — the SMS INVITE path gets the same rung ──────────────────
26532653
//
2654-
// Its OWN describe, sibling to #14762 above rather than nested inside it:
2654+
// Its OWN describe, sibling to commit 35e94c96b's above, not nested inside it:
26552655
// the reporter path is what the next reader greps, and these pins answer
26562656
// for #14641, not for the card that gave the OTP send its rung.
26572657
describe("#14641 — the invitation SMS reads the invitee's own locale", () => {
@@ -2858,7 +2858,7 @@ describe('AuthManager', () => {
28582858
expect(data.acceptUrl).toBe('http://localhost:3000/_console/accept-invitation/tok456');
28592859
});
28602860

2861-
// #11741 — the invitation producer HOLDS an organization (the invitation
2861+
// commit b706af987 — the invitation producer HOLDS an organization (the invitation
28622862
// row's own organizationId), so it threads that exact value into
28632863
// SendTemplateInput for the sys_email.organization_id stamp. Auth mail
28642864
// that genuinely has no organization (password reset / verification /
@@ -4086,15 +4086,15 @@ describe('AuthManager', () => {
40864086
expect(written).toEqual(['hash:current', 'hash:old1']); // prepend + trim to 2
40874087
});
40884088

4089-
// ---- #8676: the same control, against an engine that actually STRIPS ----
4089+
// ---- commit d6e80b28b: the same control, against an engine that actually STRIPS ----
40904090
//
40914091
// ⚠️ Every test above uses `makeEngine`, which hands back the stored object
40924092
// untouched. That is a faithful model of a strip-less engine — and it is
4093-
// precisely why those tests carry NO information about #8676: once
4093+
// precisely why those tests carry NO information about commit d6e80b28b: once
40944094
// `sys_account.password` and `previous_password_hashes` are `internal:
40954095
// true`, the REAL engine omits both from this read, with no `isSystem`
40964096
// carve-out and in spite of the explicit projection (#7728's design;
4097-
// measured against a real ObjectQL engine + stub driver on #8676, which
4097+
// measured against a real ObjectQL engine + stub driver for commit d6e80b28b, which
40984098
// returned `{"id":"a1"}` for the exact query at `assertPasswordNotReused`).
40994099
// `compareList` then empties, the loop never runs, `PASSWORD_REUSE` is
41004100
// never thrown, and the method's own `catch { return undefined }` means
@@ -4188,7 +4188,7 @@ describe('AuthManager', () => {
41884188
});
41894189

41904190
it('⛔ the recovery is LOAD-BEARING: drop the accessor and the control provably dies', async () => {
4191-
// The falsification arm. This is the pre-#8676 shape — a stripping
4191+
// The falsification arm. This is the shape before commit d6e80b28b — a stripping
41924192
// engine with no privileged accessor — and it is what every assertion
41934193
// in this block would look like if the recovery were removed. Pinned so
41944194
// the four tests above can never pass vacuously: if the strip stopped

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

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ import {
127127
interpolatePhoneSms,
128128
loadPhoneSmsTemplateBody,
129129
} from './phone-sms-texts.js';
130-
// #14762 — the stored rung of the ruled locale ladder reuses the messaging
130+
// commit 35e94c96b — the stored rung of the ruled locale ladder reuses the messaging
131131
// seam's normalizer rather than growing a second one. `normalizeRecipientLocale`
132132
// is the platform's ONE reader of a value at rest in `sys_user.locale`, and its
133133
// refusal of the stringified-nothing literals (`"undefined"`, `"null"`) is part
@@ -1691,7 +1691,7 @@ export class AuthManager {
16911691
// background-task handling (see sendVerificationEmail) and the
16921692
// forget-password route always returns {status:true}, so this never
16931693
// leaks whether an address exists nor turns the request into a 500.
1694-
// #14762 — the ladder's stored rung. It matters most HERE: an
1694+
// commit 35e94c96b — the ladder's stored rung. It matters most HERE: an
16951695
// admin-initiated reset (`admin-import-users.ts` calls
16961696
// `requestPasswordReset`) reaches this callback with the ADMIN's
16971697
// request, so without this rung the user's mail carries the admin's
@@ -1756,7 +1756,7 @@ export class AuthManager {
17561756
// template/loader errors, and returns status:'failed' on transport
17571757
// errors — surface both so resend is honest and signup stays
17581758
// resilient via better-auth's background-task error handling.
1759-
// #14762 — the stored rung, same ladder as the reset above. An
1759+
// commit 35e94c96b — the stored rung, same ladder as the reset above. An
17601760
// admin re-triggering verification for a user is the same
17611761
// requester-is-not-the-recipient shape.
17621762
const storedLocale = await this.storedRecipientLocale({ id: user.id });
@@ -2164,7 +2164,7 @@ export class AuthManager {
21642164
// guard itself now lives in ONE module both call sites share —
21652165
// `last-local-credential.ts`, whose header records this trap.
21662166
//
2167-
// ⚠️ `/admin/remove-user` IS ALSO SHADED NOW (#11477) — and it DOES
2167+
// ⚠️ `/admin/remove-user` IS ALSO SHADED NOW (commit 6dd3e6968) — and it DOES
21682168
// still reach this hook, which is the opposite of the line above
21692169
// and is the point. Its mount only runs `gateAdmin` and then
21702170
// RE-DISPATCHES the request through `handleRequest`, so it re-enters
@@ -2575,7 +2575,7 @@ export class AuthManager {
25752575
// default root domain — see project-provisioning.ts) pass CSRF checks
25762576
// without operators having to configure trustedOrigins manually.
25772577
//
2578-
// NON-PRODUCTION ONLY (#10366). This substitution is a development
2578+
// NON-PRODUCTION ONLY (commit bbe643c08). This substitution is a development
25792579
// convenience and is now gated on the same `NODE_ENV` dev signal used
25802580
// by the fallback auth secret and the dev Origin synthesis below, so
25812581
// the boundary this comment claims is the boundary that is enforced.
@@ -3369,7 +3369,7 @@ export class AuthManager {
33693369
// `routes/crud-invites.mjs`, so an existing account being invited
33703370
// elsewhere reaches this callback normally). Their column is a
33713371
// language they chose for themselves — the same authority the
3372-
// reset / verification sends read since #14762.
3372+
// reset / verification sends read since commit 35e94c96b.
33733373
// 2. NO row — a genuinely new invitee. Their language is still truly
33743374
// unknown at invitation time, so the deployment default stands,
33753375
// exactly as before.
@@ -3411,7 +3411,7 @@ export class AuthManager {
34113411
},
34123412
relatedObject: 'sys_invitation',
34133413
relatedId: invitation.id,
3414-
// #11741 — the invitation HOLDS its organization; thread it so
3414+
// commit b706af987 — the invitation HOLDS its organization; thread it so
34153415
// the sys_email row is stamped. Org-less auth mail (reset /
34163416
// verification / magic link) deliberately threads nothing.
34173417
...(invitation.organizationId
@@ -5157,7 +5157,7 @@ export class AuthManager {
51575157
}
51585158

51595159
/**
5160-
* [#11640] Whether an outbound email transport is wired RIGHT NOW.
5160+
* [commit bf8d129b5] Whether an outbound email transport is wired RIGHT NOW.
51615161
*
51625162
* The one public read of the fact every verification link depends on: with
51635163
* no transport the `sendVerificationEmail` callback has nowhere to send, so
@@ -5198,7 +5198,7 @@ export class AuthManager {
51985198
* entirely and `EmailService`'s ladder resolves its documented `en-US`
51995199
* default exactly as before.
52005200
*
5201-
* #14762 layered the per-recipient stored preference on TOP of both rungs:
5201+
* Commit 35e94c96b layered the per-recipient stored preference on TOP of both rungs:
52025202
* `sys_user.locale` (#13881, ruling 2026-09-01) when the account holds one,
52035203
* then this request's `Accept-Language`, then the deployment default. The
52045204
* request rung did not lose its argument — it is still what answers for an
@@ -5222,7 +5222,7 @@ export class AuthManager {
52225222
// address that would actually land.
52235223
const target = newEmail.trim().toLowerCase();
52245224
if (!target) return;
5225-
// #14762 — the stored rung on top of the #14319 ladder. The recipient is
5225+
// commit 35e94c96b — the stored rung on top of the #14319 ladder. The recipient is
52265226
// the account holder, so their own column outranks the header the
52275227
// request happened to carry.
52285228
const storedLocale = from.id ? await this.storedRecipientLocale({ id: from.id }) : undefined;
@@ -5343,7 +5343,7 @@ export class AuthManager {
53435343
// one provider template covers sign-in and reset, and the SMS reveals
53445344
// nothing about what the code unlocks.
53455345
//
5346-
// #14762 — the recipient of an OTP IS the user, so the locale is theirs to
5346+
// commit 35e94c96b — the recipient of an OTP IS the user, so the locale is theirs to
53475347
// name: `sys_user.locale` first, the deployment default underneath.
53485348
//
53495349
// ⚠️ The row is looked up here rather than taken from the callback: the
@@ -5460,7 +5460,7 @@ export class AuthManager {
54605460
* `kernel:ready` and on every settings change (same pattern as
54615461
* {@link setAppName}). Unset ⇒ the built-in English text.
54625462
*
5463-
* #14762 — this is now the SECOND rung, not the whole answer. The OTP send
5463+
* Commit 35e94c96b — this is now the SECOND rung, not the whole answer. The OTP send
54645464
* reads the recipient's own `sys_user.locale` first (#13881, ruling
54655465
* 2026-09-01, the same column the messaging channels resolve per recipient)
54665466
* and falls here when the account holds none. #14641 gave the SMS INVITE
@@ -5513,7 +5513,7 @@ export class AuthManager {
55135513
*
55145514
* Per-user locale EXISTS since #13881 (maintainer ruling 2026-09-01):
55155515
* `sys_user.locale`, resolved per recipient by service-messaging for
5516-
* notification mail (`recipient-locale.ts`). #14762 layered it on top of
5516+
* notification mail (`recipient-locale.ts`). Commit 35e94c96b layered it on top of
55175517
* this ladder for the sends that hold a recipient row — reset, verification
55185518
* and the change-email notice — so the order is stored → request → this
55195519
* rung, per the #14788 option-D ruling of 2026-09-03. Nothing here changed:
@@ -5530,7 +5530,7 @@ export class AuthManager {
55305530
private emailLocale?: string;
55315531

55325532
/**
5533-
* #14762 — the ladder's TOP rung: the recipient's own `sys_user.locale`,
5533+
* Commit 35e94c96b — the ladder's TOP rung: the recipient's own `sys_user.locale`,
55345534
* read best-effort off the identity row.
55355535
*
55365536
* Returns `undefined` for every shape that cannot name a language — no data
@@ -5545,7 +5545,7 @@ export class AuthManager {
55455545
* The read is one row on an indexed predicate, projected to the single
55465546
* column, under a system context — the recipient's own language must resolve
55475547
* regardless of who triggered the send, which is exactly the
5548-
* admin-initiated case #14762 was about, and the INVITER-triggered case
5548+
* admin-initiated case commit 35e94c96b fixed, and the INVITER-triggered case
55495549
* #14641 added. Three predicates, one per caller shape: `sys_user.id` (the
55505550
* sends that hold a user row), the unique `phone_number` (the SMS sends,
55515551
* which are handed a number and nothing else), and the unique `email` (the
@@ -5580,7 +5580,7 @@ export class AuthManager {
55805580
* what the ladder's "no locale means the DOCUMENTED default" contract is
55815581
* written against.
55825582
*
5583-
* #14762 — three rungs now, in the order ruled for #14788 on 2026-09-03
5583+
* Commit 35e94c96b — three rungs now, in the order ruled for #14788 on 2026-09-03
55845584
* (option D): the recipient's own **stored** `sys_user.locale` → the
55855585
* **request**'s `Accept-Language` (#14319) → the **deployment** default
55865586
* (#8195). The recorded reasoning is that a value the user chose is stronger
@@ -5615,7 +5615,7 @@ export class AuthManager {
56155615
* one exists, else the built-in bilingual text. Template lookups are
56165616
* best-effort — an outage must never block an OTP send.
56175617
*
5618-
* #14762 — `storedLocale` is the recipient's own `sys_user.locale` when the
5618+
* Commit 35e94c96b — `storedLocale` is the recipient's own `sys_user.locale` when the
56195619
* caller could resolve one ({@link storedRecipientLocale}); the deployment
56205620
* default stands underneath it. There is NO request rung on this surface:
56215621
* the ruled ladder's middle rung is the request's `Accept-Language`, and an
@@ -5626,7 +5626,7 @@ export class AuthManager {
56265626
* row as {@link phoneSmsLocaleChain}'s terminal floor exactly as before.
56275627
*
56285628
* A caller that passes nothing — or one whose recipient resolves no row —
5629-
* gets exactly the pre-#14762 deployment-default behaviour. #14641 made the
5629+
* gets exactly the deployment default, as before commit 35e94c96b. #14641 made the
56305630
* SMS invite path a passer rather than an abstainer; it is no longer the
56315631
* standing example of a caller that names nothing.
56325632
*/
@@ -7551,10 +7551,10 @@ export class AuthManager {
75517551
* (this file, ~line 671) declares `{ info?; warn }` and NO `error`, and it is
75527552
* re-exported from the package `index.ts`, so adding `error?` is a
75537553
* published-shape change. #12981's ruling routes that LEVEL question to
7554-
* #13398 and tells this batch to fix the SILENCE only — the same split
7555-
* batches 1 and 2 landed for `plugin-security`'s two exported sinks. `warn`
7556-
* is the guaranteed channel here and the lowest level a reader still reads as
7557-
* a failure, so nothing is lost but loudness.
7554+
* the published-sink ruling (commit e238c79f0) and tells this batch to fix the
7555+
* SILENCE only — the same split batches 1 and 2 landed for `plugin-security`'s
7556+
* two exported sinks. `warn` is the guaranteed channel here and the lowest
7557+
* level a reader still reads as a failure, so nothing is lost but loudness.
75587558
*
75597559
* ⛔ Call `warn` through the PROPERTY, never through an extracted reference —
75607560
* `@objectstack/core`'s `ObjectLogger` is class-based and its `warn` reaches
@@ -8023,7 +8023,7 @@ export class AuthManager {
80238023
fields: ['id', 'password', 'previous_password_hashes'],
80248024
context: SYSTEM_CTX,
80258025
} as any);
8026-
// [#8676] Both columns are `internal: true`, so the engine's read path
8026+
// [commit d6e80b28b] Both columns are `internal: true`, so the engine's read path
80278027
// omits them from the row above — with no `isSystem` carve-out and in
80288028
// spite of the explicit projection (#7728's design). Recover them
80298029
// through the privileged accessor, or `compareList` below is empty and
@@ -8071,7 +8071,7 @@ export class AuthManager {
80718071
context: SYSTEM_CTX,
80728072
} as any);
80738073
if (!account?.id) return;
8074-
// [#8676] As above — the flagged column is omitted from the read, so
8074+
// [commit d6e80b28b] As above — the flagged column is omitted from the read, so
80758075
// recover it before extending the ring. Without this the ring is rebuilt
80768076
// from an empty history on every change and never grows past one entry.
80778077
await recoverInternalFieldsForSystemRead(

0 commit comments

Comments
 (0)