M2: Postgres-hardening slice (ADR-011) — drop Redis, PostgresOtpStore/SessionStore, advisory locks #120
Labels
No labels
epic
phase-0
phase-1
phase-2
phase-3
phase-4
phase-5
phase-6
phase-7
phase-8
phase-9
priority/P0
priority/P1
priority/P2
type/backend
type/client
type/docs
type/ops
type/security
type/spike
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
primatekuntech/failsulit#120
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Umbrella for the M2 Postgres-hardening slice per ADR-011 (Postgres-only server state) — docs/redesign/2026-11-onboarding-passkey/02-architecture.md §17, dev plan v1.8 task 2.9.
Rationale (short): every 'per-process → M2 Redis hardening' TODO in the codebase collapses into a Postgres row/constraint/advisory lock; atomicity is native (no Lua); one stateful store shrinks the zero-knowledge audit surface (audits kept finding distributed-state bugs: #89, #93, bootstrap slot, TOTP guard); scale does not justify a second store pre-launch. Revisit triggers recorded in ADR-011.
Slices (each its own PR):
Acceptance: interleaved atomic-consume test green; suite green with no Redis containers in CI; compose files contain no redis service; #89 closed at slice 1; ADR-011 revisit triggers stay dormant (documented, not hypothetical claims).
Slice 1 LANDED: PR #122 squash-merged as
b5e90e3(PR runs green, #89 closed). Remaining: slice 2 PostgresSessionStore, slice 3 advisory locks + guard/budget rows, slice 4 compose/health/wiring cleanup.Slice 2 LANDED: PR #124 squash-merged as
62c6528(PR runs api-ci 12036 + security-ci 12037 green, suite 938/0/39, coverage 87.39%). PostgresSessionStore: sessions table (SHA-256 token hash at rest, sliding TTL, device fingerprint IDA-06, mfa values) + session_challenges (consume-once); SessionCleanupService sweep; AsNoTracking/set-based read paths. Scope deviation: RedisSessionStoreIntegrationTests (testcontainers) removed in this slice — the SDK Redis store has zero references left; slices 3-4 remain (advisory locks + guard/budget rows; compose/RedisHealthCheck/package cleanup).ALL SLICES LANDED — closing. Slice 1: PostgresOtpStore, atomic consume (#89 closed — PR #122,
b5e90e3). Slice 2: PostgresSessionStore + session_challenges + sweep (PR #124,62c6528). Slice 3: advisory invite locks + TotpSecurityGuard/M2M budget rows (PR #125,2c26f9a). Slice 4: Redis leaves compose/health/packages/appsettings entirely (PR #126). Final state: suite 945/0/39 Release+Debug, coverage 87.77%, compose validated Postgres-only. ADR-011's revisit triggers remain documented and dormant. The 'M2 Redis hardening' concept is retired — Postgres-hardening shipped instead.