On this page

0263. UTC wall-clock plugin

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

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.