pub fn is_protocol_timestamp(s: &str) -> boolExpand description
Whether s is a timestamp in the protocol’s temporal profile.
The profile is a strict subset of RFC 3339: YYYY-MM-DDTHH:MM:SS(.f+)?Z
— uppercase T, uppercase Z, UTC only.
Naming it a subset is deliberate honesty. RFC 3339 also permits a lowercase
t, a space separator, and numeric offsets like +02:00. Allowing those
would mean every implementation needs offset arithmetic just to compare two
timestamps, and two frames with the same instant would compare unequal as
strings — which quietly breaks the dedup and cache-key properties other
parts of the protocol depend on. One spelling per instant is worth more than
full generality here.
use contextgraph_types::is_protocol_timestamp;
assert!(is_protocol_timestamp("2026-07-20T18:00:00Z"));
assert!(is_protocol_timestamp("2026-07-20T18:00:00.123Z"));
assert!(!is_protocol_timestamp("2026-07-20T18:00:00+02:00")); // UTC only
assert!(!is_protocol_timestamp("last tuesday"));