SSM-Clock Stamp – Clock Consistency (2.3)

Purpose. Verify that the stamp’s UTC-derived clock state matches its own fields. This yields CLOCK_OK.

Deterministic mapping (UTC → angle, sector)
Given iso_utc (must be YYYY-MM-DDThh:mm:ssZ), compute:

  • unix_seconds = seconds_since_1970_UTC(iso_utc)
  • wrap360(x) = x - 360*floor(x/360)
  • theta'_deg = wrap360( (unix_seconds / 86400) * 360 )
  • rasi'_idx = floor(theta'_deg / 30)

Checks (must / should)

  • MUST (discrete sector): rasi'_idx == rasi_idx → sector matches.
  • SHOULD (formatted angle string): format theta'_deg with exactly theta_prec fractional digits (default 5) using IEEE-754 binary64 round-half-to-even, then require string equality: theta_fmt == theta_deg.
    • Tolerance option (when policy allows): if a legacy producer printed theta_deg with the right numeric value but the wrong string policy, a verifier MAY accept abs(theta'_deg - theta_deg) <= 5e-7 (about one unit in the last place at theta_prec=5). Prefer string equality when possible.

Procedure (verifier, step-by-step)

  1. Confirm iso_utc shape and no leap second (:60 forbidden).
  2. Compute unix_seconds.
  3. Compute theta'_deg and rasi'_idx as above.
  4. Sector check (MUST): compare rasi'_idx to rasi_idx.
  5. Determine p = kv:theta_prec else 5.
  6. Format theta'_deg to p digits using binary64 round-half-to-eventheta_fmt.
  7. Angle string (SHOULD): compare theta_fmt to theta_deg (string).
  8. Set CLOCK_OK = (sector_ok && (angle_ok or tolerated)).

Notes & invariants

  • theta_deg ∈ [0,360); rasi_idx ∈ {0..11}.
  • Angle print policy is part of determinism: compare as strings to avoid locale/format drift.
  • Timezones/offsets/subseconds: not allowed; only ...Z with whole seconds is valid.
  • The per-second advance is constant: dtheta_per_sec = 360/86400.

Common failure reasons

  • iso_utc includes subseconds or a timezone offset.
  • theta_deg not printed with exactly theta_prec digits.
  • Rounding mode not round-half-to-even.
  • Producer emits 23:59:60 (must be rejected upstream).

Outcome

  • Emit CLOCK_OK=true/false, plus a short reason if false (e.g., rasi mismatch, theta string mismatch).

Navigation
Back: SSM-Clock Stamp – Content Integrity (2.2)
Next: SSM-Clock Stamp – Chain Continuity (2.4)