Documentation
¶
Overview ¶
Package editorial projects selected editorial content and validates proposed replacements. It has no model client, transport, database or actor identity.
Index ¶
Constants ¶
const SharingPolicy = "reviewed-editorial-v1"
SharingPolicy identifies the reviewed-editorial-content policy in audit receipts. It is not a claim that free text or aggregate data is anonymous.
Variables ¶
var ( ErrSource = errors.New("unsupported editorial source") ErrInput = errors.New("invalid editorial input") ErrPrivacy = errors.New("private editorial text") Reserved = regexp.MustCompile(`(?i)RC_DRAFT_VALUE_|reputecast\.invalid`) Marker = regexp.MustCompile(`<!--\s*rc:[a-zA-Z0-9_-]+\s*-->`) )
var Liquid = regexp.MustCompile(`(?s)\{\{.*?\}\}|\{%.*?%\}`)
var URL = regexp.MustCompile(`(?i)(?:[a-z][a-z0-9+.-]*://|www\.|mailto:|tel:|data:)[^\s<>"']+`)
These detectors reject recognizable private records. They do not establish anonymity of arbitrary prose; people must review selected editorial sources and acknowledge residual risk before sharing. Confirmation never bypasses these checks or authorizes contact-record tools.
Functions ¶
func Chat ¶
Chat names the private record a chat message holds: "email", "phone" or "credential", or "" for none.
func Sample ¶
Sample reads visible text from supported MJML blocks, not attributes, comments, images or compliance footers. It preserves unexpanded tokens.
func SavedPolicy ¶
func SavedPolicy(source string) mjml.GeneratedPolicy
SavedPolicy snapshots capabilities only after restoration and validation.
Types ¶
type EmailContext ¶
type EmailContext struct {
Bindings []Binding
BindingPrefix string
Tokens []string
FinalPolicy mjml.GeneratedPolicy
}
EmailContext stays on the instance. Only Source may leave it. Persist the context with its immutable proposal rather than rebuilding capabilities from model output at acceptance time.
func (*EmailContext) Project ¶
func (c *EmailContext) Project(source string, links []string, before *Email, maxChars int) (Source, error)
Project keeps brand markup, URLs and token literals local. It returns visible editorial text with capabilities that are opaque to the model.
func (EmailContext) Restore ¶
func (c EmailContext) Restore(email *Email, before *Email) error
Restore validates opaque capabilities before substituting their local values. It never grants a new URL, attribute, Liquid token or executable block. The original compliance and brand sections are restored last.