Expand description
Format validators for fields the protocol declares but could not previously
check (SPEC.md §F4, §F5; issues #10 and #12).
Two guarantees were unfalsifiable before this module existed:
- Bi-temporal retrieval.
valid_from/valid_to/recorded_at/as_ofwere free-form strings with no format rule anywhere, so a provider emitting"valid_from": "last tuesday"was fully conformant. A guarantee nothing can falsify is not a guarantee. - Provenance integrity.
Provenance.digestwas documented as the thing that lets a host detect tampering “before the frame enters a prompt”, but no grammar said which algorithms were valid, what case the hex was in, or which bytes were digested. Two independent providers would disagree and both would be “conformant”.
These validators are deliberately dependency-free — no chrono, no regex.
contextgraph-types is the crate every provider in every language ports
from, and each dependency it carries is one more thing an implementer has to
reproduce or justify.
Constants§
- DIGEST_
ALGORITHMS - The digest algorithms this protocol revision defines.
Functions§
- format_
protocol_ timestamp - Render a Unix instant (seconds since the epoch, UTC) as a protocol
timestamp: the exact spelling
is_protocol_timestampaccepts. - is_
protocol_ timestamp - Whether
sis a timestamp in the protocol’s temporal profile. - is_
well_ formed_ digest - Whether
sis a well-formed content digest:<algorithm>:<lowercase hex>, e.g.sha256:followed by 64 lowercase hex characters (SPEC.md§F5).