Skip to content

ADR-0127 records two measurably-wrong facts about the session-cache doors: a boot refusal that does not exist, and a cookieCache cost overstated as identical to its sibling's #12734

Description

@os-litant

Filed unassigned by the os-dev working #12547 (branch claude/issue-12547-cookiecache-disclosure). ⛔ No domain:*, no pm:queue — routing and grading are triage's. Not fixed in that PR: amending an accepted ADR's Decision and Consequences sections is a judgment call outside a disclosure card's declared file surface.

The two statements

Both on origin/main in docs/adr/0127-authorization-cache-invalidation-contract-and-ttl-bound.md:

1. Consequences, the "one disclosed gap" paragraph:

The secondaryStorage door into D7's rejected architecture is boot-refused and pinned; the cookieCache door reaches the same architecture and is unguarded.

⚠️ There is no ObjectStack-authored boot refusal on the secondaryStorage door. This is the same false premise that mis-graded #12547 and cost that card a full retriage round — it is now recorded in an accepted ADR, where the next reader will pick it up as settled fact. Measured (and verified first-hand by the triage seat on 2026-08-27):

git grep -n "secondaryStorage" origin/main -- packages/plugins/plugin-auth/src | grep -iE "throw|refus|reject|assert"

yields exactly one hit, and it is a test titlesession-of-record.test.ts "the DEFAULT composition refuses to boot with a secondaryStorage rather than degrading quietly". That test's own comment attributes the refusal to better-auth 1.7's hard-refuse of secondaryStorage without storeSessionInDatabase, conditional on the OIDC provider being enabled. Meanwhile auth-manager.ts passes a host-supplied secondaryStorage straight through, and cacheSecondaryStorage() is deliberately exported, under an export comment that states the posture: "exported rather than auto-wired … so a host opts into that trade explicitly or not at all."

⇒ The ruled posture (maintainer, 2026-08-27, on #12547) is opt-in with disclosed cost on both doors, no ObjectStack-authored boot refusal on either. The ADR records the opposite.

2. D7, last sentence:

cookieCache is a different key reaching the same architecture, with the same result.

The direction is right; "the same result" is measurably too strong. Measured against the installed better-auth 1.7.1 while implementing #12547 — three differences, each named with the file it was read from:

secondaryStorage cookieCache
session of record moves into the cache — createSession skips the sys_session row stays in sys_session — read-side only, so admin session lists, the concurrent-cap count and D4's audit trail stay correct
staleness window unbounded — the cache is the record bounded, per-client: cookieCache.maxAge, default 300s (dist/cookies/index.mjs:50, :99)
stateless refresh extending the window n/a force-disabled whenever a database is configured, which ObjectStack always does (dist/context/create-context.mjs:149-165)
sensitive operations still cache-backed already bypass itgetAuthoritativeSessionFromCtx / sensitiveSessionMiddleware re-read with disableCookieCache: true when stateful (dist/api/routes/session.mjs:270-280)

Confirmed empirically, not only by reading: an ablation in #12547's PR plumbs cookieCache through and the new pin goes red with a revoked session still authenticating — so the failure direction is real, and it is the magnitude that the ADR overstates.

Why this is worth a card rather than a shrug

An overstated disclosure is its own defect, in the direction that costs the most. #12547's brief put it exactly right: a cost note that overstates the danger "teaches operators to discount the sibling door's warning too." The secondaryStorage warning is the one that must land — it is the unbounded one — and pairing it with a claim a careful reader can falsify in ten minutes is how a real warning gets read as boilerplate.

And statement 1 has already demonstrated its cost once: it is precisely the belief that produced the wrong grading on #12547.

Options, so grading is cheap

shape note
A amend both sentences in place, citing the measurement smallest change; the ADR's decisions (D7's ruling) are untouched and correct — only two factual claims about the current implementation are wrong
B amend statement 1 only statement 2's direction is right and D7's ruling does not depend on the magnitude; defensible if the seat prefers minimum edit to an accepted record
C leave it, on the record ⛔ the reading that already cost one card a retriage round

⛔ No recommendation from this seat beyond noting that neither statement's correction changes any ADR decision — D7 stands either way, and #12547's PR does not depend on this being fixed.

Re-check commands:

git grep -n "secondaryStorage" origin/main -- packages/plugins/plugin-auth/src | grep -iE "throw|refus|reject|assert"
git grep -n "boot-refused and pinned" origin/main -- docs/adr
git grep -n "with the same result" origin/main -- docs/adr

⛔ Reverse-check any zero with a term known present in the same file.


Generated by Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions