Deterministic slot-based timestamp allocator for installer migrations (GEN-07).
Replaces the old offset_timestamp/1 helper that lived in
Mix.Tasks.Sigra.Install before Phase 11, which based timestamps
on :calendar.universal_time, making re-runs
non-deterministic and cross-feature ordering implicit. The slot
allocator:
- Walks the canonical feature list in order.
- For each feature, iterates
migrations/1slot entries in the order the feature returned them. - Assigns
base_time + N secondswhereNis a globally incrementing counter across all features.
This means Features.Core's :primary slot always gets an earlier
timestamp than Features.Organizations's first slot, regardless
of wall-clock time. Cross-feature ordering is static, not timing-
dependent.
Idempotent re-run is handled by the walker layer: if a migration
file already exists on disk that matches target_basename, the
walker reuses its filename instead of allocating a new timestamp.
Summary
Functions
@spec allocate(features :: [module()], base_time :: DateTime.t()) :: %{ required(module()) => %{required(atom()) => String.t()} }