chore(memory): BDR-099 V1-2.5 decisions, LRN-113 TOTP reuse, Storage 409, sandbox order

This commit is contained in:
bchanot committed 2026-11-03 11:05:44 +01:00
1 parent b4415a382f
commit 7f618d05a2
3 files changed
+22

No files matched your search

+8
View File
@@ -777,3 +777,11 @@ Supersedes [[LRN-102]].
**Context**: V1-2.5 sandbox proofs on GoTrue v2.197.0 (mfa-behaviour.sandbox.ts, IDENTITY.md §4.1).
**Pattern**: once a TOTP factor verified: password change and recovery-link reset refused at aal1 (401 insufficient_aal) → reset/change UI must step up first; email change same. Removing verified factor downgrades only sessions last verified with that factor; their access token keeps aal2 claim until expiry (has_mfa true, has_aal2_session false). supabase-js `mfa.listFactors().totp` hides unverified factors → read `all`.
**Apply**: never assume aal from claim alone for sensitive RPCs (session row check); any password/email flow on MFA accounts needs a step-up path; factor lists show unverified ones.
## LRN-113 — GoTrue v2.197 TOTP reuse observed; Storage 400 with statusCode 409; fresh sandbox, order test-db, e2e:shell, test (2026-11-03)
**Context**: V1-2.5 checkpoint gates (2026-11-02/03) on sandbox `pnpm db:sandbox` (GoTrue v2.197.0 image defaults, Storage API of the pinned Supabase images).
**Pattern**:
1. TOTP reuse, OBSERVED on sandbox only (IDENTITY §4.1 case 11), no general guarantee: GoTrue keeps no used-code record. Code C of step N accepted by session A, by second aal1 session B, by A again; session D in step N+1 accepted (one step skew); session E in N+2 refused 422 `mfa_verification_failed`. Span 30-60 s, replayable by any session holding password within it. CLI/DEV config sets no replay option, same behaviour expected but unmeasured; other GoTrue versions/configs unverified.
2. Storage duplicate upload: answers HTTP 400 with body `statusCode: "409"` (KeyAlreadyExists), not HTTP 409. Delete of missing object likewise HTTP 400 + `statusCode` 404. Test/client must read body `statusCode`; any other 400 still fails.
3. Sandbox suites share one stack: e2e:shell seeds content-addressed drawings + working copies that later `test` cases meet (duplicate upload, `working_copy.exists`), so a case green only from 2nd run or only after another suite hides defects. Gate run = fresh stack (`db:sandbox down` + `up fresh`), order `test-db → e2e:shell → test`, each case robust to state the earlier suites leave; never re-run until green.
**Apply**: never cite TOTP span as a guarantee (measured fact + version); Storage error handling reads body `statusCode`; V1-2.6+ gates start from fresh sandbox in that order, report state-dependent failures instead of masking them.