zdump_rs/lib.rs
1//! zdump-rs — a bounded, independent Rust TZif **witness** companion to zic-rs.
2//!
3//! `zic-rs` is the compiler (tzdb source → TZif). `zdump-rs` is the inspection companion: it reads TZif
4//! and renders what it *means* (offset / is_dst / abbreviation) at explicit instants, as deterministic
5//! JSON witness rows, so the evidence court has an **independent second reader** to cross-check against
6//! reference `zdump`.
7//!
8//! ## Scope
9//! Phase 1 (`T23.zdump-witness.1`):
10//! - read TZif v1/v2/v3/v4 (independent reader; no shared code with zic-rs)
11//! - evaluate offset/is_dst/abbreviation at explicit UTC instants
12//! - emit deterministic JSON witness rows
13//!
14//! Phase 2 (`T23.zdump-witness.2`):
15//! - **interpret the POSIX footer** so instants beyond the last explicit transition are *projected*
16//! (offset/is_dst/abbreviation), matching reference `zdump` far-future — `posix` module
17//! - **transition listing** over a year window (the `zdump -v` analog) — `Tzif::transitions_in`
18//! - **expose the leap-second table** in the listing
19//!
20//! ## Explicit NON-claims (guarded as hard as the capability)
21//! - NOT a full `zdump` replacement · NOT exact stdout/stderr parity · NOT all flags
22//! - NOT locale behaviour · NOT a replacement oracle (reference `zdump` stays the oracle)
23//! - NOT civil-time truth
24//! - does NOT apply leap-second corrections to the displayed wall time for `right/` zones (the per-type
25//! offset/is_dst/abbreviation are reported correctly; the TAI-scale wall rendering near leaps is a
26//! tracked Phase-3 refinement)
27
28#![forbid(unsafe_code)]
29
30pub mod civil;
31pub mod posix;
32pub mod tzif;
33pub mod witness;
34
35pub use tzif::{parse, Observation, TransitionRow, Tzif};
36pub use witness::WitnessRow;
37
38/// The fixed, declared probe-instant set (`--probe-default`): pre-epoch, the 32-bit `time_t` floor/ceiling,
39/// a few civil years around the admitted 2026b release, and a far-future (footer-governed) point. Shared by
40/// the CLI and the golden test so they cannot drift.
41pub const PROBE_DEFAULT: &[&str] = &[
42 "1901-12-13T20:45:52Z",
43 "1933-01-01T00:00:00Z",
44 "1970-01-01T00:00:00Z",
45 "2000-06-01T00:00:00Z",
46 "2026-01-01T00:00:00Z",
47 "2026-07-01T00:00:00Z",
48 "2038-01-19T03:14:07Z",
49 "2100-01-01T00:00:00Z",
50 "2200-07-01T12:00:00Z",
51];