Skip to main content

Module trust

Module trust 

Source
Expand description

Trust state machine — v0.1 minimal subset.

Tier semantics:

  • UNTRUSTED: card pinned, SAS not yet confirmed; messages ignored.
  • VERIFIED: SAS confirmed bilateral; messages accepted.
  • ATTESTED: reserved (v0.2+) — used today only for self-attest.
  • TRUSTED: reserved (v0.2+).

Promotion is one-way (UNTRUSTED → VERIFIED). Demotion would be ambiguous in a bilateral setting and is deliberately not modeled.

Enums§

Tier

Functions§

add_agent_card_pin
Pin a peer’s card into our trust at the given tier (default UNTRUSTED).
add_self_to_trust
Self-pin our own keypair into trust at ATTESTED. Convenience for wire init.
empty_trust
get_tier
promote_to_verified
Promote UNTRUSTED → VERIFIED. Returns Err(reason) if not pinned or already past UNTRUSTED (promotion is one-way).
tier_order
Tier ranking — higher is more trusted. Useful for >= gating.

Type Aliases§

Trust
Trust state — kept as a free-form JSON Value so we can persist + read with any conforming impl. v0.2+ may swap this for a typed struct.