You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Each phase has explicit actions, tests, exit criteria and a short risk/mitigation summary. Work should proceed sequentially unless a parallel low‑risk task is approved (e.g., docs updates or isolated unit tests).
111
+
112
+
---
113
+
114
+
## Phase Details
115
+
116
+
### Phase 0: Verification Baseline
117
+
Deliverables:
118
+
- Current metrics snapshot (coverage, Lighthouse, Axe)
119
+
- Inventory of hardcoded `storeId` usages (grep + review)
120
+
- Pricing tamper test script (automated E2E that attempts price override)
121
+
122
+
Risks:
123
+
- Hidden edge cases where `storeId` is injected at runtime. Mitigation: static grep + runtime assertion tests.
124
+
125
+
Exit Criteria:
126
+
- Inventory complete and checked into `specs/002-harden-checkout-tenancy/artifacts/`
- Ensure deduplication by `(storeId,email)` and single opt-in flow; send CSV export link via email + in-app notification when admin requests subscriber export
- Add E2E isolation attempts that simulate tampering and concurrency
222
+
- Integrate coverage thresholds into CI and enforce gates
223
+
224
+
Testing:
225
+
- Automated Vitest + Playwright runs with coverage reporting
226
+
227
+
Exit:
228
+
- Coverage thresholds met and CI gating green
229
+
230
+
### Phase 8: Documentation, Observability & Final Audit
231
+
Actions:
232
+
- Update `docs/design-system.md` with error classes and cache tag conventions
233
+
- Update `docs/testing-strategy.md` and `CHANGELOG.md` entries
234
+
- Produce final audit report and update risk register
235
+
- Run full accessibility scan and store artifacts
236
+
237
+
Testing:
238
+
- Review checklists; grep verification of no hardcoded `storeId`; accessibility scans (axe)
239
+
240
+
Exit:
241
+
- Final audit report stored and all acceptance criteria satisfied
242
+
243
+
---
244
+
245
+
## Architectural Decisions
246
+
- Use Server Actions where form-based flows are appropriate (newsletter, optional checkout Server Action) while ensuring auth and price recalculation happen on the server boundary.
247
+
- Keep a clear services layer for pure business logic; transaction wrapper isolated at `src/services/transaction.ts`.
248
+
- Centralize error classes and codes in `src/lib/errors.ts`; export enumerated error codes for clients and logs.
249
+
- Keep cache tags minimal in the first iteration to avoid complexity; expand based on metrics.
250
+
- Centralize API middleware for auth, rate limiting, validation, logging and requestId propagation to improve consistency and observability.
251
+
252
+
## Testing Strategy (Detailed)
253
+
- Use deterministic fixtures under `tests/fixtures` for product/discount/inventory states.
254
+
- Payment validator to support stubbed scenarios (valid, invalid, expired, network-failure).
255
+
- Include timeout & rate limit tests using synthetic rapid calls.
256
+
- Integrate accessibility checks (axe) into E2E for checkout and newsletter forms.
257
+
258
+
## Performance Strategy
259
+
- Instrument query timing around new transaction boundaries and log slow queries for review.
0 commit comments