BigSaltyMan/cuesmith/trim does not have a README file

    TrimError

    pub(all) struct TrimError {
    kind : TrimErrorKind
    path : String
    message : String
    span :
    Span
    ?
    } derive(Eq,
    Debug
    )

    Structured diagnostic error returned when trimming fails or cannot verify semantic equivalence.

    TrimError::format

    fn TrimError::format(self : TrimError) -> String

    Formats self as a human-readable diagnostic string with optional path and line:column location.

    TrimErrorKind

    pub(all) enum TrimErrorKind {
    SyntaxError
    EvalError
    ModuleError
    EquivalenceProofFailed
    ResourceLimit
    } derive(Eq,
    Debug
    )

    Diagnostic categories produced by the trim package.

    TrimFileResult

    pub(all) struct TrimFileResult {
    path : String
    original : String
    trimmed : String
    changed : Bool
    removed_paths : Array[String]
    proof_verified : Bool
    } derive(Eq,
    Debug
    )

    Trimming outcome for a single writable CUE source file.

    TrimOptions

    pub(all) struct TrimOptions {
    max_probes : Int
    limits :
    EvalLimits

    } derive(Eq,
    Debug
    )

    Configuration options for CUE redundant-field trimming.

    TrimOptions::default

    fn TrimOptions::default() -> TrimOptions

    Returns the default TrimOptions (max_probes: 256, default EvalLimits).

    TrimResult

    pub(all) struct TrimResult {
    files : Array[TrimFileResult]
    changed : Bool
    proof_verified : Bool
    probes_used : Int
    } derive(Eq,
    Debug
    )

    Aggregate trimming outcome across a package or file set.

    DEFAULT_MAX_TRIM_PROBES

    let DEFAULT_MAX_TRIM_PROBES : Int

    Default maximum number of semantic equivalence probe evaluations performed during a single trim invocation.

    trim_against_schema

    fn trim_against_schema(schema : String, data : String, data_path? : String, options? : TrimOptions) -> Result[TrimFileResult, Array[TrimError]]

    Trims redundant fields from data given a read-only schema source in the same package scope.

    trim_package

    fn trim_package(fs :
    ModuleFs
    , target_dir : String, pkg_name? : String, cwd? : String, options? : TrimOptions, mod_limits? :
    ModLimits
    ) -> Result[TrimResult, Array[TrimError]]

    Resolves a CUE package via @modsys.resolve_package and trims redundant fields in the package's target-directory files while treating ancestor inherited files and imported dependency packages as read-only context.

    trim_source

    fn trim_source(source : String, path? : String, options? : TrimOptions) -> Result[TrimFileResult, Array[TrimError]]

    Trims redundant fields from a single CUE source string.

    trim_sources

    fn trim_sources(sources : Array[(String, String)], readonly_sources? : Array[(String, String)], package_deps? : Array[
    PackageUnit
    ], options? : TrimOptions) -> Result[TrimResult, Array[TrimError]]

    Trims redundant concrete fields across sources (writable (path, source) pairs) in the presence of optional readonly_sources and pre-resolved package_deps, verifying full semantic equivalence both during pruning and via a mandatory post-trim re-parse + re-evaluation self-proof.

    unified_diff

    fn unified_diff(path : String, original : String, trimmed : String) -> String

    Computes a deterministic unified diff between original and trimmed for path. Returns "" when original == trimmed.

    unified_diff_bounded

    fn unified_diff_bounded(path : String, original : String, trimmed : String, max_output_bytes : Int) -> Result[String,
    LimitError
    ]

    Computes a deterministic unified diff between original and trimmed for path while aborting early once UTF-8 output exceeds max_output_bytes.

    Source Files