SSM-Clock Stamp – Parse & Validate Fields (2.1)

Purpose. Parse the single-line ASCII stamp, enforce shape and domains, and normalize the optional kv: tail for later checks.

Input (one line)
SSMCLOCK1|iso_utc|rasi_idx|theta_deg|sha256(file)|chain[|kv:...]

Step 1 — Split (arity)

  • Split on |. Accept 6 fields (base) or 7 fields if a final kv: tail is present.

Step 2 — Prefix / arity check

  • Require parts[0] == "SSMCLOCK1" and len(parts) ∈ {6,7}.
  • Reject lines with leading/trailing separators or internal spaces.

Step 3 — Types / bounds (per-field)

  • iso_utc: matches YYYY-MM-DDTHH:MM:SSZ (UTC only, seconds only, no offsets, no subseconds).
  • rasi_idx: integer with 0 <= rasi_idx <= 11.
  • theta_deg: decimal with 0 <= theta_deg < 360 (will be string-checked later using theta_prec).
  • sha256(file): lowercase 64-hex (label is historical; actual digest algorithm may be in kv:algo).
  • chain: lowercase 64-hex.

Step 4 — Leap-second ban (must)

  • Reject any iso_utc claiming :60 (23:59:60 not allowed).

Step 5 — kv: tail (if present)
Tail must start with kv: and contain ;-separated key=value pairs (ASCII; no spaces).

  • Recognize: algo, chain_algo, theta_prec, float, time_mode, ssmc_hint_min, a_stamp, plus optional provenance chain_id, device.
  • Defaults when absent: algo=sha256, chain_algo=sha256, theta_prec=5, float=ieee75464, time_mode=derived_utc.
  • Domains (enforce):
    • algo ∈ {sha256, sha3_256, blake2b-256} → digest length 64.
    • chain_algo ∈ {sha256, sha3_256, blake2b-256} → digest length 64.
    • theta_prec ∈ {3..9} (integer).
    • float = ieee75464 (mandatory).
    • time_mode ∈ {derived_utc, observed}.
    • ssmc_hint_min = Δ with |Δ| <= 30 (minutes, numeric).
    • a_stamp ∈ (-1,+1) (numeric; metadata only).
    • chain_id matches [0-9a-fA-F]{8}; device matches [A-Za-z0-9._-]{1,32}.
  • Forward-compatibility: Unknown keys MUST be ignored.
  • Malformed tail: duplicate keys, out-of-domain values, spaces, or illegal characters → FAIL (syntax).

Outcome of 2.1

  • If all shape/domain checks pass, emit a normalized parse object for the next steps: Content Integrity (2.2), Clock (2.3), Chain (2.4), Anchor (2.5).

Navigation
Back: SSM-Clock Stamp – Normative Verification — File, Clock, Chain (2)
Next: SSM-Clock Stamp – Content Integrity (2.2)