test(api): add assistant split regression runner

This commit is contained in:
2026-04-01 00:51:23 +02:00
parent 254f2caa94
commit f2d65d3cd4
3 changed files with 259 additions and 1 deletions
+151
View File
@@ -0,0 +1,151 @@
# Assistant Tool Test Split Migration
Stand: 2026-04-01
Diese Notiz hält fest, wie die alten Assistant-Tool-Monolith-Tests in kleinere, fachlich geschnittene Suiten aufgeteilt wurden und wie die Regression dafür reproduzierbar ausgeführt wird.
## Ziel
- Alte Sammeltests waren konfliktanfällig und schwer gezielt zu regressieren.
- Neue Split-Tests schneiden entlang fachlicher Domänen und realer Access-/Mutation-Verträge.
- Die Regression soll explizit und reproduzierbar laufen, statt implizit über breite Dateiglob-Matches.
## Regression ausführen
Im Paket `@capakraken/api`:
```bash
pnpm test:assistant-split
```
Der Runner führt fünf explizite Vitest-Batches plus abschließenden API-Typecheck aus:
1. Allocation und Quick Assign
2. Timeline und Advanced Ranking
3. Dispo
4. Estimate
5. Insights und Misc
## Legacy-zu-Split-Mapping
### `assistant-tool-policy.test.ts`
Aufgeteilt in:
- `assistant-tool-policy-access.test.ts`
- `assistant-tool-policy-admin.test.ts`
- `assistant-tool-policy-planning.test.ts`
- ergänzend domänische Guards in `assistant-tools-auth-guard.test.ts`
Abgedeckt werden damit insbesondere:
- Sichtbarkeit von Tools je Rolle
- Permission-Gates für Planning, Costs und `useAssistantAdvancedTools`
- Trennung zwischen Self-Service, Admin- und Controller-Surface
### `assistant-tools-advanced.test.ts`
Aufgeteilt in:
- `assistant-tools-advanced-resource-ranking.test.ts`
- `assistant-tools-advanced-timeline-entries-view.test.ts`
- `assistant-tools-advanced-project-timeline-context.test.ts`
- `assistant-tools-advanced-project-shift-preview.test.ts`
- `assistant-tools-timeline-resource-selection.test.ts`
Abgedeckt werden damit insbesondere:
- Advanced-Ranking und Project-Resource-Selection
- Timeline-Readmodels und Shift-Preview
- Access-Gates für `viewPlanning`, `viewCosts` und `useAssistantAdvancedTools`
### `assistant-tools-audit.test.ts`
Aufgeteilt in:
- `assistant-tools-audit-log-list.test.ts`
- `assistant-tools-audit-read.test.ts`
- `assistant-tools-audit-entity-summary.test.ts`
- `assistant-tools-audit-errors-auth.test.ts`
- ergänzend `assistant-tools-query-change-history.test.ts`
Abgedeckt werden damit insbesondere:
- Listen-, Detail- und Summary-Reads
- stabile Auth-/Role-Fehler für Controller-only Reads
- Query-Change-History als separates Controller-Readmodel
### `assistant-tools-country.test.ts`
Aufgeteilt in:
- `assistant-tools-country-list.test.ts`
- `assistant-tools-country-get.test.ts`
- `assistant-tools-country-mutations-success.test.ts`
- `assistant-tools-country-mutations-errors.test.ts`
- `assistant-tools-metro-city-mutations-success.test.ts`
- `assistant-tools-metro-city-mutations-errors.test.ts`
Abgedeckt werden damit insbesondere:
- Country-Readmodels
- Fehleroberflächen für Not Found und Duplikate
- Country- und Metro-City-Mutationen
Hinweis:
`get_country` verlangt inzwischen explizit `VIEW_ALL_RESOURCES`; die neuen Split-Tests sind an diesem aktuellen Vertrag ausgerichtet.
### `assistant-tools-holidays.test.ts`
Aufgeteilt in:
- `assistant-tools-holiday-calendar-get.test.ts`
- `assistant-tools-holiday-calendar-get-errors.test.ts`
- `assistant-tools-holiday-calendars-list.test.ts`
- `assistant-tools-holiday-calendar-mutations-success.test.ts`
- `assistant-tools-holiday-calendar-mutations-guards.test.ts`
- `assistant-tools-holiday-entry-mutations-success.test.ts`
- `assistant-tools-holiday-entry-mutations-errors.test.ts`
- `assistant-tools-holiday-resolution-calendar-preview.test.ts`
- `assistant-tools-holiday-resolution-regional-resource.test.ts`
- `assistant-tools-holiday-capacity.test.ts`
- `assistant-tools-holiday-chargeability.test.ts`
- `assistant-tools-holiday-budget-shoring.test.ts`
- `assistant-tools-holiday-simulation.test.ts`
- `assistant-tools-holiday-staffing-suggestions.test.ts`
Abgedeckt werden damit insbesondere:
- Holiday-Calendars und deren CRUD
- Region-/Resource-spezifische Auflösung
- Holiday-Einfluss auf Capacity, Chargeability, Budget und Staffing
### `assistant-tools-import-export.test.ts`
Aufgeteilt in:
- `assistant-tools-import.test.ts`
- `assistant-tools-export.test.ts`
- `assistant-tools-dispo-import.test.ts`
- `assistant-tools-dispo-import-batch-list-cancel.test.ts`
- `assistant-tools-dispo-import-batch-delegation.test.ts`
- `assistant-tools-dispo-staged-listings-resources-projects.test.ts`
- `assistant-tools-dispo-staged-unresolved-read.test.ts`
- `assistant-tools-dispo-staged-vacations-read.test.ts`
- `assistant-tools-dispo-staged-assignments-read.test.ts`
- `assistant-tools-dispo-staged-resolution.test.ts`
Abgedeckt werden damit insbesondere:
- CSV-Import-/Export-Pfade
- Permission-Gates wie `importData`
- Dispo-Import-Staging, Delegation, Commit und Cancel
## Verifikationsstand
Der aktuelle Split-Runner wurde gegen die genannten Batches und den API-Typecheck validiert.
Bewusst noch nicht Teil dieses Dokuments:
- konfliktträchtige, bereits separat bearbeitete Notification-/Timeline-Support-Dateien
- breit gefächerte Repo-weite Vitest-Globs, weil diese in der Vergangenheit versehentlich mehr als die Ziel-Suite eingesammelt haben