Declarative command-output filter registry: the filter-pack schema, its stage-execution
engine, and the trust store that gates project- and user-authored packs.
Canonical mode matrix: the single source of truth for which transforms run in which
mode, at what ratio cap, for which task scopes and input formats. secret_redaction is
deliberately absent from this table — it runs unconditionally before the pipeline and
cannot be disabled (see budget::CompressionPolicyBuilder::build).
Reversible evidence store and retrieval: content-addressed storage of pre-transform
originals, plus the [retrieval]tokenfold.toml schema block that configures it.
Fail-closed safety invariants: JSON validity, object key-order preservation, protected
content survival, and no redaction bypass — the four properties every transform in the
pipeline must leave intact regardless of which transforms ran before it. The
pipeline checks these after every transform; a violation rolls that transform back
(pre-transform bytes restored) rather than shipping a corrupted or unsafe output.
Transform implementations. Each submodule exposes a pure function over bytes/text; the
pipeline (crate::pipeline) owns all bookkeeping (token counts, TransformReport,
safety validation/rollback). Canonical IDs and ordering live in crate::modes.