Imp.Playbook.Entry (Imp v0.5.0)

Copy Markdown View Source

An immutable, normalized playbook entry with a stable identity and hash chain.

Summary

Functions

Builds an entry, raising when its content violates the policy.

Normalizes content for exact deduplication and canonical storage.

Types

status()

@type status() :: :active | :inactive

t()

@type t() :: %Imp.Playbook.Entry{
  content: String.t(),
  harmful: non_neg_integer(),
  hash: String.t(),
  helpful: non_neg_integer(),
  id: String.t(),
  parent_hash: String.t() | nil,
  provenance: Imp.Playbook.Provenance.t(),
  revision: pos_integer(),
  section: String.t(),
  status: status()
}

Functions

new(content, opts \\ [])

@spec new(String.t(), keyword()) :: t()

Builds an entry, raising when its content violates the policy.

normalize(content)

@spec normalize(String.t()) :: String.t()

Normalizes content for exact deduplication and canonical storage.