# Coverage Matrix with Sections & Resources

Reference for building and validating the coverage matrix that maps requirements to modules, sections, and resources.

## Section Rule (CRITICAL)

Sections are functional zones (list, dashboard, approve, import, rapport...).
- `create` and `edit` are SEPARATE PAGES with their own URL routes (`/create` and `/:id/edit`)
- `detail` is a page with tabs accessible by clicking a row in `list`, NOT a standalone section

## Coverage Matrix Template

Print a markdown table with columns: **Fonctionnalité | Priorité | Module | Section | Resources clés | Onglets détail**

### Example

```
| Fonctionnalité | Priorité | Module | Section | Resources clés | Onglets détail |
|---|---|---|---|---|---|
| Gestion des employés | mustHave | Employees | list | employee-grid, employee-filters, employee-form | Infos, Contrats, Documents |
| Suivi des activités | mustHave | TimeTracking | list | activity-grid, activity-filters, activity-form | Infos, Imputations |
| Saisie d'absences | mustHave | TimeTracking | list | absence-grid, absence-form, absence-calendar | Infos, Justificatifs |
| Rapports temps | shouldHave | TimeTracking | dashboard | time-kpi-cards, time-summary-chart | — |
| Validation absences | shouldHave | TimeTracking | approve | approval-queue, status-timeline | — |
| Export PDF/Excel | couldHave | TimeTracking | rapport | export-panel | — |
| Intégration paie | outOfScope | — | — | — | — |
```

## Priority Distribution POST-CHECK (BLOCKING)

```javascript
coverageItems = cadrage.coverageMatrix[]
mustHaveCount = coverageItems.filter(i => i.category === "mustHave").length
shouldHaveCount = coverageItems.filter(i => i.category === "shouldHave").length
couldHaveCount = coverageItems.filter(i => i.category === "couldHave").length
outOfScopeCount = coverageItems.filter(i => i.category === "outOfScope").length

IF shouldHaveCount === 0 AND couldHaveCount === 0 AND outOfScopeCount === 0:
  → FAIL: ALL {mustHaveCount} items are mustHave — no distribution.
  → ACTION: Return to Phase 3 section 4c and apply MoSCoW question.
  → DO NOT write cadrage until at least shouldHave OR outOfScope has ≥ 1 item.
  → EXCEPTION: If client explicitly confirmed "tout est indispensable" during
    Phase 3 section 4c, accept but ADD a changelog entry:
    "Client confirmed all {N} features as mustHave after MoSCoW challenge"
```

## Cross-Cutting Coverage POST-CHECK (WARNING)

```javascript
FOR each item in coverageMatrix WHERE item.module === null:
  IF item.category === "mustHave":
    → WARNING: "{item.item}" is mustHave but has no assigned module.
    → Ensure it is covered by infrastructure or a cross-cutting concern.
    → Add a note explaining HOW it will be implemented (e.g., "handled by platform notification service").
  IF item.anticipatedSections.length === 0 AND item.category !== "outOfScope":
    → WARNING: "{item.item}" has no anticipated sections — will it be implemented?
```

## Building Coverage Matrix from Feature Analysis

For EACH distinct feature/requirement identified during phases 2-4:

1. Create an entry in `cadrage.coverageMatrix[]`
2. Assign it to mustHave, shouldHave, couldHave, or outOfScope
3. Assign the module that will cover it (or null if cross-cutting)
4. **List anticipated sections** (Level 4) — ONLY functional zones
5. **List anticipated resources** (Level 5) for each section
6. **List detail page tabs** — for entities accessible via click from `list`

### Validation

- Every line of the original prompt must map to at least one coverageMatrix entry.
- If a feature is in mustHave → it MUST have at least one anticipated section.
- Accepted suggestions from Phase 4 must appear in the matrix.
