# TASK 4.1: Add regression coverage for async provisioning and selective bootstrap

## Summary

Add regression coverage proving that provisioning now runs asynchronously from credential writes, customer CRUD no longer blocks on bootstrap, and tenant bootstrap installs only the required staging artifacts while preserving global curated artifacts.

This task verifies the full slice end-to-end across API, service, and bootstrap behavior.

## Dependencies

- [TASK 2.1](./TASK2.1.md) - Add background provisioning job and enqueue it from credential create and update
- [TASK 2.2](./TASK2.2.md) - Remove synchronous customer provisioning and inline credential handling from customer CRUD
- [TASK 3.1](./TASK3.1.md) - Resolve enabled source services and extend bootstrap requests
- [TASK 3.2](./TASK3.2.md) - Refactor tenant bootstrap SQL loading to selected staging plus global curated

## Files to Modify

Expected implementation touch points:

- `backend/tests/Kds.Ai.ApiService.Tests/Kds.Ai.ApiService.Tests/Services/CustomerEtlProvisioningServiceTests.cs`
- `backend/tests/Kds.Ai.ApiService.Tests/Kds.Ai.ApiService.Tests/Endpoints/AdminCustomerOnboardingFlowTests.cs`
- additional endpoint/job tests under `backend/tests/Kds.Ai.ApiService.Tests/`
- warehouse bootstrap tests under `backend/tests/` as needed

## Required Behavior

- Cover that customer create and update no longer block on synchronous provisioning.
- Cover that credential create enqueues provisioning.
- Cover that credential update enqueues provisioning.
- Cover that credential delete does not enqueue provisioning and does not imply warehouse cleanup.
- Cover that provisioning state transitions are exposed to the API.
- Cover that source-aware bootstrap selects only the expected staging artifacts.
- Cover that curated artifacts still remain part of bootstrap.

## Acceptance Criteria

- [ ] Customer CRUD async behavior is covered
- [ ] Credential-triggered enqueue behavior is covered
- [ ] Credential delete no-op warehouse behavior is covered
- [ ] Provisioning status contract is covered
- [ ] Selective staging bootstrap behavior is covered
- [ ] Global curated bootstrap behavior is covered

## Notes

- Prefer focused regression tests over broad end-to-end duplication.
- Use existing fake TickerQ helpers and warehouse bootstrap test seams where possible.
