# Phase 10: Hardening and Rollout

## Objective

Stabilize V2 for production rollout with performance, permissions, and operational safety checks.

---

## Tasks

### 10.1 Permission parity audit

- Build a V1 vs V2 permission matrix.
- Validate role-based access for all V2 modules.

### 10.2 Performance hardening

- Profile heavy dashboard/cardex queries.
- Add indexing and short-lived caching where needed.
- Validate acceptable response times on realistic dataset volumes.

### 10.3 Regression and smoke coverage

- End-to-end smoke scenarios for top workflows:
  - planning dashboard
  - cardex support flow
  - multi-order invoice + payment + invoice send
- Keep V1 smoke suite green.

### 10.4 Rollout controls

- Use feature flag rollout by cohort.
- Add monitoring dashboards and error alerts for V2 routes.
- Prepare rollback checklist to V1-only mode.

---

## File Impact (Expected)

- tests across `tests/Feature/*` and `tests/Unit/*`
- monitoring/observability configuration
- feature flag configuration and rollout docs

---

## Acceptance Criteria

- No blocking regression on V1 operations.
- V2 key workflows pass automated and manual smoke checks.
- Rollback to V1-only mode is tested and documented.

---

## Tests

- Full regression subset on admin-critical paths.
- Performance baselines for dashboard and cardex.
- Access control matrix tests for all V2 sections.
