Files
specs/openspec/changes/archive/2026-08-23-harden-auth-and-cache-concurrency/tasks.md
T

24 lines
2.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
## 1. Bounded cache страниц журнала
- [x] 1.1 Добавить в `BrokerageOperationsService` failing regression tests для canonical categories/default `to` bucket, сохранения ownership checks и eviction после 100 уникальных страниц; не добавлять test-only clock seam для TTL third-party library.
- [x] 1.2 Добавить `lru-cache` как прямую production dependency и реализовать domain-local Ledger Page Cache с TTL 30 секунд, max 100 и canonical key без обхода connection/account ownership checks.
- [x] 1.3 Запустить focused cache spec и backend unit suite; устранить каждый regression failure.
## 2. Детерминированная auth concurrency
- [x] 2.1 Создать `AuthService` service-level tests с stateful Prisma fake для P2002 loser при параллельной регистрации и ожидаемого `409 EMAIL_ALREADY_REGISTERED`.
- [x] 2.2 Добавить barrier-based CAS test двух refresh одного token: один победитель, один `401`, predicate содержит id и old refresh hash, Session победителя не отзывается.
- [x] 2.3 Преобразовать ожидаемый Prisma P2002 от `user.create` в существующий `ConflictException`, не скрывая остальные database errors.
- [x] 2.4 Реализовать refresh rotation через conditional `updateMany`; при CAS loser вернуть `UNAUTHORIZED` без revoke Session и сохранить lifecycle cookie через существующий controller boundary.
- [x] 2.5 Запустить focused auth spec и backend unit suite; устранить каждый regression failure.
## 3. Постоянная документация
- [x] 3.1 Довести ADR-009, `CONTEXT.md`, feature documentation authentication и brokerage account ledger до фактически реализованных cache и refresh policies без создания параллельных SDD-артефактов в docs.
## 4. Verification до archive
- [x] 4.1 Выполнить backend non-mutating gates под Node 22: `npm run lint`, `npm run typecheck:app`, `npm run typecheck:test` и `npm test -- --runInBand`; не выдавать deferred `test:e2e` за passing gate.
- [x] 4.2 Выполнить `openspec validate harden-auth-and-cache-concurrency --type change --strict --store wealth-ledger-specs`, strict validation synced specs, authority verifier и `git diff --check` во всех затронутых repositories.
- [x] 4.3 Выполнить applicable pre-archive `opsx-verify` procedure и independent read-only review implementation, delta specs, документации и scope; устранить каждый blocking result до archive.