# `MedEx.ClockAlign`
[🔗](https://github.com/nshkrdotcom/med_ex/blob/med_ex-v0.2.0/components/core/med_core/lib/med_ex/clock_align.ex#L1)

Exact affine clock bounds from supplied rate and timestamp-error qualifications.

Times are already normalized to microseconds. A rational is an integer or
`{numerator, nonzero_denominator}`. Policy supplies positive `a_min/a_max`,
combined timestamp/model `epsilon_us`, explicit host/device `generation`,
`host_now_us`, `max_probe_age_us`, inclusive `valid_device_us`, and nonnegative
`holdover_rate` (extra host microseconds per device microsecond outside the
observed span). Zero holdover rate explicitly assumes no additional wander.

These bounds/validity assumptions must come from caller qualification; this
solver cannot establish them. Epsilon must already cover device timestamp
error in host units. Probes contain `generation, h1, d2, d3, h4` with integer
timestamps. Foreign, malformed or stale input fails; only the newest 64
otherwise valid probes constrain the polygon. Retained inputs preserve provenance.

An anchor supplies generation, sample_index, device_us, period_min_us,
period_max_us and error_us. Its error covers acquisition/quantization in device
units; its period interval must hold over the requested samples. Stream/epoch
ownership and hardware evidence are caller contracts, never inferred here.

# `at_device_time`

# `fit`

# `interval`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
