0263. UTC wall-clock plugin
- Status: Accepted (maintainer, 2026-11-17); Forge P5, M-HTTP.13
- Date: 2026-11-17
- Plan: M-HTTP.13; hosting H3
Context
ADR-0245:27 lists wall-clock time as a toolchain gap (expiry,
log timestamps). Clock.now_ms is monotonic elapsed
time from process start (crates/harness/src/interp.rs
PlatformOp::ClockNowMs), not Unix UTC. The
platform/native and interpreter trees are frozen for Forge P5.
Hosting token records use the second-resolution shape
2027-01-01T00:00:00Z, and H3 evidence calls for a
deterministic clock.
Decision
Provide plugins/wallclock via FFI (ADR-0151).
now takes a data-driven Source
(System or Fixed seconds). Linux and
macOS read clock_gettime(CLOCK_REALTIME); unsupported
platforms fail at compile time. There is no fallback to monotonic
time, process start, time(), or
gettimeofday. Values are UTC Unix seconds in 0 ..=
253402300799. Format and parse accept only
YYYY-MM-DDTHH:MM:SSZ.
expired(now, expires) is true when
now >= expires. A test hook injects OS failures
only; it never fabricates a successful time.
Alternatives considered
- PlatformOp /
Cap::Clockmethod — requires changes in frozen trees; a later move requires a superseding ADR.Clock.now_msstays the monotonic duration clock. time()/gettimeofday— no advantage, andtime()hides errors.- Millisecond resolution — not needed for token expiry; parked.
- Offsets and fractional seconds in parse — wider attack surface, and hosting does not need them.
- A global or env test override — not data-driven, process-wide.
Consequences
Consumers must admit ffi in their capability
ceiling, including format/parse-only users. No capability gates
wall-clock reads beyond ffi. The interpreter needs a
C compiler for its FFI host (ADR-0152). Platforms other than Linux
and macOS cannot build this plugin. macOS is compile-unverified on
the Linux development host.