Implements the atomic alias swap step (plan §13.1 step 5) for online
resharding. This is the cutover phase where the alias flips from the
live index to the shadow index, stopping dual-write.
Changes:
- Add task_store field to ReshardExecutor and implement alias_swap()
function using alias_swap_phase()
- Add AliasSwapFailed variant to MiroirError
- Add Serialize derive to AliasSwapResult for logging/metrics
- Create integration test suite (p5_1_e_reshard_alias_swap.rs) covering:
- Atomic alias flip to shadow index
- History recording for rollback capability
- Error cases (nonexistent alias, multi-target alias)
- History retention limits
- Idempotency
The executor now properly performs the alias flip via task_store.flip_alias(),
which atomically updates the alias target and records history for rollback.
After this phase, client writes target ONLY the new index.
Closes: miroir-uhj.1.5
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>