Skip to content
Toolkit

ADR-0150 — A bound is an instant, and a refusal is not a clamp

Status: Accepted · Date: 2026-08-31 · Track: 002 close-out (LEDGER drain) · Supersedes: nothing · Builds on: ADR-0040, ADR-0149

Context

DateTimePicker had no min or max. Four of its five call sites are start/end pairs — DisplayRulesEditor's scheduling window and LinkDetailPage's scheduled_at/scheduled_end — and neither half constrained the other, so a schedule could be saved that ended before it opened. The serving path reads both (007 phase 01), so the window it evaluates was empty and the link never showed.

Two questions had to be answered before any of it could be built.

What granularity is a bound? Every native and hand-rolled date control in the tree bounds by day. But this control's value is an instant, and the pairs it serves are instants: "no earlier than the 14th at 09:30" is the actual constraint, and a day-granular reading of it either bars the 14th entirely — making the bound itself unreachable — or admits 00:00 on the 14th, which is before the bound.

What happens to an out-of-range input? The two available answers are clamping (move it to the nearest legal instant) and refusing.

Decision

A bound is an instant. A day is barred only when the whole day is outside the range. An out-of-range commit is refused and stated, never clamped.

  • dayOutOfRange compares day ends. A day is before the range when its last millisecond is before min, and after it when its first is after max. The day a bound falls on is therefore a boundary day: in range, with part of its clock out.
  • On the boundary day the time field carries the bound, and only there — a min copied onto every day in the range would bar a morning three days later. <input type="time">'s min/max are advisory, so they mark the field; commit is what enforces.
  • Refused, not clamped. Clamping is ADR-0149's silent rewrite one bound over: the user asked for an instant the control may not carry, and moving them to the nearest legal one without a word is how a form saves a time nobody chose. Nothing is emitted, and ADR-0149's note region — already in the panel, already a live region — says which bound answered. One region, three things it can say.
  • The cursor is clamped, because the grid roves. A disabled <button> cannot take focus, so a cursor parked outside the range is a panel that opens with nothing focused and a roving tab stop that has gone. It is clamped on the value re-sync and on a change of bounds, which is the pair case rather than a corner: the end picker's min is the start picker's value, so moving the start moves this picker's range under a cursor that did not move. An arrow key at the edge of the range therefore holds rather than stepping onto a disabled day, and PageDown into a month the bound cuts short lands on the bound instead of refusing to page.
  • An arrow that could only page to disabled days is disabled, read off the adjacent month's nearest edge.

Consequences

  • The two pairs are wired: DisplayRulesEditor's end picker and LinkDetailPage's take the start as min. ApiTokensCard's expiry is the fifth call site and is not a pair; whether a token may be minted already expired is a product question this track does not own.
  • Nothing is bounded that was not bounded before, so no stored row changes meaning. The guard is on the write path only; the server still validates what it validates.
  • The bound is not enforced against a value handed in from outside. A controlled picker shows what it is given, and a component that refused to render its own prop would hide a row that already exists rather than reporting it — which is Field's error slot's job, not this control's.

Source: docs/decisions/0150-a-bound-is-an-instant-and-a-refusal-is-not-a-clamp.md

Library