moonchange

    Deterministic repository change-policy evaluation and review planning for MoonBit

    change-governance
    code-owners
    review-policy
    ci-gates
    Download zip
    Version
    0.2.1
    License
    MIT
    Last updated
    13 hours ago
    Downloads
    2

    Dependencies

    #MoonChange

    MoonChange is an original MoonBit library and CLI for repository change governance. It turns a path-scoped policy plus change evidence into a deterministic review plan and a passed, review, or rejected gate.

    It is designed for maintainers who need policy-as-code for ownership routing, approval quorums, required checks and labels, line budgets, forbidden operations, binary restrictions, and release-note obligations.

    #Why

    Repository review rules are often scattered across CODEOWNERS files, CI YAML, team conventions, and release checklists. MoonChange makes those obligations explicit and testable before a change is merged. The same policy can audit an explicit change manifest or metadata extracted from a Git unified diff.

    MoonChange does not implement a diff algorithm or patch engine. For the optional diff input, it calls the mature mizchi/bit_apply@0.46.4 parse_patches API and converts only its PatchInfo metadata into governance inputs.

    #Capabilities

    • Parse and canonically serialize bounded policy, manifest, and evidence files.
    • Match safe repository-relative paths with *, ?, and whole-segment **.
    • Resolve owners by highest specificity, with the last rule winning ties.
    • Aggregate all matching governance rules rather than selecting only one.
    • Enforce owner approvals, checks, labels, per-path and total line budgets, forbidden operations, binary restrictions, and release-note requirements.
    • Review both source and destination paths for rename operations.
    • Produce stable findings, an aggregate review plan, and CI-oriented exit codes.
    • Emit deterministic versioned JSON for audit, explain, lint, and comparison workflows without changing the default human-readable output.
    • Explain one path, lint ineffective policies, and compare old/new policies for a concrete path inventory.
    • Consume unified-diff file metadata through mizchi/bit_apply without reimplementing diff generation, hunk parsing, patch application, or reversal.

    #Quick Start

    Install a current MoonBit toolchain, then run:

    moon update moon check --target wasm-gc --deny-warn moon test --target wasm-gc moon run cmd/moonchange --target js -- demo

    Audit the committed explicit manifest example:

    moon run cmd/moonchange --target js -- audit \ --policy examples/policy.mcp \ --manifest examples/manifest.mcm \ --format json

    Audit the same workflow from a real Git diff plus review evidence:

    moon run cmd/moonchange --target js -- audit-diff \ --policy examples/policy.mcp \ --evidence examples/evidence.mce \ --diff examples/change.diff

    Explain and lint policy behavior:

    moon run cmd/moonchange --target js -- explain \ --policy examples/policy.mcp --path src/security/auth.mbt moon run cmd/moonchange --target js -- lint --policy examples/policy.mcp

    Compare policy versions over a reviewed path inventory:

    moon run cmd/moonchange --target js -- compare \ --before examples/policy-before.mcp \ --after examples/policy.mcp \ --paths examples/paths.txt

    Exit code 0 means passed/clean, 1 means review evidence or lint attention is needed, and 2 means rejected or invalid input.

    All report commands accept --format text|json. JSON documents use explicit schema identifiers such as moonchange.audit.v1; field order is deterministic, but consumers should select fields by name.

    #Policy Format

    MOONCHANGE_POLICY 1 DEFAULT approvals=1 max_total=500 require_owned=yes OWNER **/* @maintainers OWNER src/security/** @security,@maintainers RULE source src/** approvals=1 checks=unit labels=code forbid=delete max_lines=200 release_note=no binary=deny

    Owner lists are alternatives used to satisfy the path quorum. All matching RULE lines contribute obligations. Approval counts take the maximum, line budgets take the minimum, sets are unioned, and boolean restrictions use the strictest result. Use max_total=- or max_lines=- for no limit. A quorum larger than the resolved owner pool is rejected as an impossible policy.

    #Explicit Manifest Format

    MOONCHANGE 1 ID PR-42 ACTOR @alice APPROVAL @maintainers CHECK unit passed LABEL code RELEASE_NOTE no CHANGE modify src/main.mbt 8 2 text

    For rename and copy, provide old and new paths. Other operations take one path. Each change ends with additions, deletions, and text or binary.

    #Diff Evidence Format

    audit-diff uses a separate MOONCHANGE_EVIDENCE 1 file containing the same ID, actor, approval, check, label, and release-note fields. File operations and line counts come exclusively from upstream PatchInfo values.

    For callers constructing Evidence directly, duplicate check names are reconciled conservatively: failed dominates pending, which dominates passed. Text parsers reject duplicates so file inputs remain unambiguous.

    #Library

    let policy = @moonchange.parse_policy(policy_text).unwrap()
    let changes = @moonchange.parse_manifest(manifest_text).unwrap()
    let report = @moonchange.evaluate(policy, changes)
    inspect(report.status(), content="Passed")

    pkg.generated.mbti records the complete generated public interface.

    #Verification

    moon fmt --check moon check --target wasm-gc --deny-warn moon check --target wasm --deny-warn moon check --target js --deny-warn moon check --target native --deny-warn moon test --target wasm-gc moon test --target wasm moon test --target js moon test --target native

    Native compilation and execution require a C compiler. GitHub Actions performs native checks, tests, a release build, and real CLI flows on Ubuntu.

    #Boundaries

    MoonChange never applies patches, reconstructs hunks, generates diffs, mutates a repository, calls Git, contacts GitHub, or evaluates branch protection rules. The diff adapter cannot identify binary content because upstream PatchInfo does not expose that flag; use an explicit manifest when binary policy matters. See Support, Architecture, and Originality for exact behavior and provenance.

    #License

    MoonChange is MIT licensed. Original implementation: okMambaOut; maintenance contributors are recorded in CONTRIBUTORS.md. See Third-Party Notices and AI Usage.

    #Maintenance quality evidence

    The path matcher uses linear auxiliary state without changing its public API. The suite includes 13,091 exhaustive oracle pairs and maximum-length/depth regressions. See the maintenance report for exact scope, state-slot reductions, reproduction commands and measurement limitations.

    #MoonCakes distribution

    The maintained release is distributed as ZJH-666-ZJH/moonchange@0.2.1:

    moon add ZJH-666-ZJH/moonchange@0.2.1

    Import ZJH-666-ZJH/moonchange in your package manifest (for example with alias moonchange). The repository remains okMambaOut/moonchange; this is an explicitly attributed maintenance distribution, not a claim that the original project was authored by ZJH-666-ZJH. Existing consumers of an older namespace must update their module dependency and package import paths.

    AuditReport

    pub struct AuditReport {
    change_id : String
    status : GateStatus
    total_lines : Int
    decisions : Array[PathDecision]
    findings : Array[Finding]
    plan : ReviewPlan
    } derive(Eq,
    Debug
    )

    AuditReport::change_id

    fn AuditReport::change_id(self : AuditReport) -> String

    AuditReport::decisions

    fn AuditReport::decisions(self : AuditReport) -> Array[PathDecision]

    AuditReport::findings

    fn AuditReport::findings(self : AuditReport) -> Array[Finding]

    AuditReport::has_code

    fn AuditReport::has_code(self : AuditReport, code : String) -> Bool

    AuditReport::plan

    fn AuditReport::plan(self : AuditReport) -> ReviewPlan

    AuditReport::status

    fn AuditReport::status(self : AuditReport) -> GateStatus

    AuditReport::to_json

    fn AuditReport::to_json(self : AuditReport) -> String

    AuditReport::to_text

    fn AuditReport::to_text(self : AuditReport) -> String

    AuditReport::total_lines

    fn AuditReport::total_lines(self : AuditReport) -> Int

    Change

    pub struct Change {
    kind : ChangeKind
    old_path : String?
    new_path : String?
    additions : Int
    deletions : Int
    binary : Bool
    } derive(Eq,
    Debug
    )

    Change::additions

    fn Change::additions(self : Change) -> Int

    Change::changed_lines

    fn Change::changed_lines(self : Change) -> Int

    Change::deletions

    fn Change::deletions(self : Change) -> Int

    Change::is_binary

    fn Change::is_binary(self : Change) -> Bool

    Change::kind

    fn Change::kind(self : Change) -> ChangeKind

    Change::new

    fn Change::new(kind : ChangeKind, old_path : String?, new_path : String?, additions : Int, deletions : Int, binary? : Bool) -> Result[Change, Diagnostic]

    Change::new_path

    fn Change::new_path(self : Change) -> String?

    Change::old_path

    fn Change::old_path(self : Change) -> String?

    Change::policy_path

    fn Change::policy_path(self : Change) -> String

    ChangeKind

    pub(all) enum ChangeKind {
    Add
    Modify
    Delete
    Rename
    Copy
    } derive(Eq,
    Debug
    )

    ChangeKind::parse

    fn ChangeKind::parse(value : String) -> ChangeKind?

    ChangeKind::to_text

    fn ChangeKind::to_text(self : ChangeKind) -> String

    ChangeSet

    pub struct ChangeSet {
    id : String
    changes : Array[Change]
    evidence : Evidence
    } derive(Eq,
    Debug
    )

    ChangeSet::changes

    fn ChangeSet::changes(self : ChangeSet) -> Array[Change]

    ChangeSet::evidence

    fn ChangeSet::evidence(self : ChangeSet) -> Evidence

    ChangeSet::id

    fn ChangeSet::id(self : ChangeSet) -> String

    ChangeSet::new

    fn ChangeSet::new(id : String, changes : Array[Change], evidence : Evidence) -> Result[ChangeSet, Diagnostic]

    ChangeSet::to_text

    fn ChangeSet::to_text(self : ChangeSet) -> String

    CheckResult

    pub struct CheckResult {
    name : String
    state : CheckState
    } derive(Eq,
    Debug
    )

    CheckResult::name

    fn CheckResult::name(self : CheckResult) -> String

    CheckResult::new

    fn CheckResult::new(name : String, state : CheckState) -> CheckResult

    CheckResult::state

    fn CheckResult::state(self : CheckResult) -> CheckState

    CheckState

    pub(all) enum CheckState {
    Passed
    Failed
    Pending
    } derive(Eq,
    Debug
    )

    CheckState::parse

    fn CheckState::parse(value : String) -> CheckState?

    CheckState::to_text

    fn CheckState::to_text(self : CheckState) -> String

    CommandResult

    pub struct CommandResult {
    exit_code : Int
    output : String
    } derive(Eq,
    Debug
    )

    CommandResult::exit_code

    fn CommandResult::exit_code(self : CommandResult) -> Int

    CommandResult::output

    fn CommandResult::output(self : CommandResult) -> String

    Diagnostic

    pub struct Diagnostic {
    code : String
    location : String
    message : String
    expected : String
    actual : String
    } derive(Eq,
    Debug
    )

    A stable, machine-readable policy, manifest, or evaluation failure.

    Diagnostic::actual

    fn Diagnostic::actual(self : Diagnostic) -> String

    Diagnostic::code

    fn Diagnostic::code(self : Diagnostic) -> String

    Diagnostic::expected

    fn Diagnostic::expected(self : Diagnostic) -> String

    Diagnostic::location

    fn Diagnostic::location(self : Diagnostic) -> String

    Diagnostic::message

    fn Diagnostic::message(self : Diagnostic) -> String

    Diagnostic::new

    fn Diagnostic::new(code : String, location : String, message : String, expected : String, actual : String) -> Diagnostic

    Diagnostic::to_text

    fn Diagnostic::to_text(self : Diagnostic) -> String

    Evidence

    pub struct Evidence {
    actor : String
    approvals : Array[String]
    checks : Array[CheckResult]
    labels : Array[String]
    release_note : Bool
    } derive(Eq,
    Debug
    )

    Evidence::actor

    fn Evidence::actor(self : Evidence) -> String

    Evidence::approvals

    fn Evidence::approvals(self : Evidence) -> Array[String]

    Evidence::checks

    fn Evidence::checks(self : Evidence) -> Array[CheckResult]

    Evidence::has_release_note

    fn Evidence::has_release_note(self : Evidence) -> Bool

    Evidence::labels

    fn Evidence::labels(self : Evidence) -> Array[String]

    Evidence::new

    fn Evidence::new(actor : String, approvals : Array[String], checks : Array[CheckResult], labels : Array[String], release_note? : Bool) -> Evidence

    Finding

    pub struct Finding {
    level : FindingLevel
    code : String
    path : String
    message : String
    } derive(Eq,
    Debug
    )

    Finding::code

    fn Finding::code(self : Finding) -> String

    Finding::level

    fn Finding::level(self : Finding) -> FindingLevel

    Finding::message

    fn Finding::message(self : Finding) -> String

    Finding::new

    fn Finding::new(level : FindingLevel, code : String, path : String, message : String) -> Finding

    Finding::path

    fn Finding::path(self : Finding) -> String

    Finding::to_json

    fn Finding::to_json(self : Finding) -> String

    Finding::to_text

    fn Finding::to_text(self : Finding) -> String

    FindingLevel

    pub(all) enum FindingLevel {
    Attention
    Blocking
    } derive(Eq,
    Debug
    )

    FindingLevel::to_text

    fn FindingLevel::to_text(self : FindingLevel) -> String

    GateStatus

    pub(all) enum GateStatus {
    Passed
    Review
    Rejected
    } derive(Eq,
    Debug
    )

    GateStatus::to_text

    fn GateStatus::to_text(self : GateStatus) -> String

    GovernanceRule

    pub struct GovernanceRule {
    name : String
    pattern : PathGlob
    approvals : Int
    checks : Array[String]
    labels : Array[String]
    forbidden : Array[ChangeKind]
    max_lines : Int?
    release_note : Bool
    allow_binary : Bool
    } derive(Eq,
    Debug
    )

    GovernanceRule::allows_binary

    fn GovernanceRule::allows_binary(self : GovernanceRule) -> Bool

    GovernanceRule::approvals

    fn GovernanceRule::approvals(self : GovernanceRule) -> Int

    GovernanceRule::checks

    fn GovernanceRule::checks(self : GovernanceRule) -> Array[String]

    GovernanceRule::forbidden

    fn GovernanceRule::forbidden(self : GovernanceRule) -> Array[ChangeKind]

    GovernanceRule::labels

    fn GovernanceRule::labels(self : GovernanceRule) -> Array[String]

    GovernanceRule::max_lines

    fn GovernanceRule::max_lines(self : GovernanceRule) -> Int?

    GovernanceRule::name

    fn GovernanceRule::name(self : GovernanceRule) -> String

    GovernanceRule::new

    fn GovernanceRule::new(name : String, pattern : PathGlob, approvals? : Int, checks? : Array[String], labels? : Array[String], forbidden? : Array[ChangeKind], max_lines? : Int?, release_note? : Bool, allow_binary? : Bool) -> Result[GovernanceRule, Diagnostic]

    GovernanceRule::pattern

    fn GovernanceRule::pattern(self : GovernanceRule) -> PathGlob

    GovernanceRule::requires_release_note

    fn GovernanceRule::requires_release_note(self : GovernanceRule) -> Bool

    LintIssue

    pub struct LintIssue {
    level : LintLevel
    code : String
    subject : String
    message : String
    } derive(Eq,
    Debug
    )

    LintIssue::code

    fn LintIssue::code(self : LintIssue) -> String

    LintIssue::level

    fn LintIssue::level(self : LintIssue) -> LintLevel

    LintIssue::message

    fn LintIssue::message(self : LintIssue) -> String

    LintIssue::subject

    fn LintIssue::subject(self : LintIssue) -> String

    LintIssue::to_json

    fn LintIssue::to_json(self : LintIssue) -> String

    LintIssue::to_text

    fn LintIssue::to_text(self : LintIssue) -> String

    LintLevel

    pub(all) enum LintLevel {
    LintInfo
    LintWarning
    LintError
    } derive(Eq,
    Debug
    )

    LintLevel::to_text

    fn LintLevel::to_text(self : LintLevel) -> String

    LintReport

    pub struct LintReport {
    issues : Array[LintIssue]
    } derive(Eq,
    Debug
    )

    LintReport::has_code

    fn LintReport::has_code(self : LintReport, code : String) -> Bool

    LintReport::has_errors

    fn LintReport::has_errors(self : LintReport) -> Bool

    LintReport::is_clean

    fn LintReport::is_clean(self : LintReport) -> Bool

    LintReport::issues

    fn LintReport::issues(self : LintReport) -> Array[LintIssue]

    LintReport::to_json

    fn LintReport::to_json(self : LintReport) -> String

    LintReport::to_text

    fn LintReport::to_text(self : LintReport) -> String

    OwnerRule

    pub struct OwnerRule {
    pattern : PathGlob
    owners : Array[String]
    } derive(Eq,
    Debug
    )

    OwnerRule::new

    fn OwnerRule::new(pattern : PathGlob, owners : Array[String]) -> Result[OwnerRule, Diagnostic]

    OwnerRule::owners

    fn OwnerRule::owners(self : OwnerRule) -> Array[String]

    OwnerRule::pattern

    fn OwnerRule::pattern(self : OwnerRule) -> PathGlob

    PathDecision

    pub struct PathDecision {
    path : String
    owners : Array[String]
    owner_pattern : String?
    matched_rules : Array[String]
    approvals : Int
    checks : Array[String]
    labels : Array[String]
    forbidden : Array[ChangeKind]
    max_lines : Int?
    release_note : Bool
    allow_binary : Bool
    } derive(Eq,
    Debug
    )

    PathDecision::allows_binary

    fn PathDecision::allows_binary(self : PathDecision) -> Bool

    PathDecision::approvals

    fn PathDecision::approvals(self : PathDecision) -> Int

    PathDecision::checks

    fn PathDecision::checks(self : PathDecision) -> Array[String]

    PathDecision::forbidden

    fn PathDecision::forbidden(self : PathDecision) -> Array[ChangeKind]

    PathDecision::labels

    fn PathDecision::labels(self : PathDecision) -> Array[String]

    PathDecision::matched_rules

    fn PathDecision::matched_rules(self : PathDecision) -> Array[String]

    PathDecision::max_lines

    fn PathDecision::max_lines(self : PathDecision) -> Int?

    PathDecision::owner_pattern

    fn PathDecision::owner_pattern(self : PathDecision) -> String?

    PathDecision::owners

    fn PathDecision::owners(self : PathDecision) -> Array[String]

    PathDecision::path

    fn PathDecision::path(self : PathDecision) -> String

    PathDecision::requires_release_note

    fn PathDecision::requires_release_note(self : PathDecision) -> Bool

    PathDecision::to_explain_json

    fn PathDecision::to_explain_json(self : PathDecision) -> String

    PathDecision::to_json

    fn PathDecision::to_json(self : PathDecision) -> String

    PathDecision::to_text

    fn PathDecision::to_text(self : PathDecision) -> String

    PathGlob

    pub struct PathGlob {
    source : String
    segments : Array[String]
    specificity : Int
    } derive(Eq,
    Debug
    )

    PathGlob::compile

    fn PathGlob::compile(source : String) -> Result[PathGlob, Diagnostic]

    PathGlob::matches

    fn PathGlob::matches(self : PathGlob, path : String) -> Bool

    PathGlob::source

    fn PathGlob::source(self : PathGlob) -> String

    PathGlob::specificity

    fn PathGlob::specificity(self : PathGlob) -> Int

    PathPolicyDelta

    pub struct PathPolicyDelta {
    path : String
    before : PathDecision
    after : PathDecision
    owners : StringDelta
    rules : StringDelta
    checks : StringDelta
    labels : StringDelta
    forbidden : StringDelta
    } derive(Eq,
    Debug
    )

    PathPolicyDelta::after

    PathPolicyDelta::before

    PathPolicyDelta::changed

    fn PathPolicyDelta::changed(self : PathPolicyDelta) -> Bool

    PathPolicyDelta::checks

    PathPolicyDelta::forbidden

    PathPolicyDelta::labels

    PathPolicyDelta::owners

    PathPolicyDelta::path

    fn PathPolicyDelta::path(self : PathPolicyDelta) -> String

    PathPolicyDelta::rules

    PathPolicyDelta::to_json

    fn PathPolicyDelta::to_json(self : PathPolicyDelta) -> String

    Policy

    pub struct Policy {
    default_approvals : Int
    max_total_lines : Int?
    require_owned : Bool
    owner_rules : Array[OwnerRule]
    rules : Array[GovernanceRule]
    } derive(Eq,
    Debug
    )

    Policy::default_approvals

    fn Policy::default_approvals(self : Policy) -> Int

    Policy::explain

    fn Policy::explain(self : Policy, path : String) -> Result[PathDecision, Diagnostic]

    Policy::max_total_lines

    fn Policy::max_total_lines(self : Policy) -> Int?

    Policy::new

    fn Policy::new(default_approvals? : Int, max_total_lines? : Int?, require_owned? : Bool, owner_rules? : Array[OwnerRule], rules? : Array[GovernanceRule]) -> Result[Policy, Diagnostic]

    Policy::owner_rules

    fn Policy::owner_rules(self : Policy) -> Array[OwnerRule]

    Policy::requires_owned_paths

    fn Policy::requires_owned_paths(self : Policy) -> Bool

    Policy::rules

    fn Policy::rules(self : Policy) -> Array[GovernanceRule]

    Policy::to_text

    fn Policy::to_text(self : Policy) -> String

    PolicyComparison

    pub struct PolicyComparison {
    paths : Array[PathPolicyDelta]
    } derive(Eq,
    Debug
    )

    PolicyComparison::changed_count

    fn PolicyComparison::changed_count(self : PolicyComparison) -> Int

    PolicyComparison::paths

    PolicyComparison::to_json

    fn PolicyComparison::to_json(self : PolicyComparison) -> String

    PolicyComparison::to_text

    fn PolicyComparison::to_text(self : PolicyComparison) -> String

    ReviewEvidence

    pub struct ReviewEvidence {
    id : String
    evidence : Evidence
    } derive(Eq,
    Debug
    )

    ReviewEvidence::evidence

    fn ReviewEvidence::evidence(self : ReviewEvidence) -> Evidence

    ReviewEvidence::id

    fn ReviewEvidence::id(self : ReviewEvidence) -> String

    ReviewEvidence::to_text

    fn ReviewEvidence::to_text(self : ReviewEvidence) -> String

    ReviewPlan

    pub struct ReviewPlan {
    required_owners : Array[String]
    approved_owners : Array[String]
    unapproved_owners : Array[String]
    required_checks : Array[String]
    passed_checks : Array[String]
    unresolved_checks : Array[String]
    required_labels : Array[String]
    present_labels : Array[String]
    missing_labels : Array[String]
    touched_rules : Array[String]
    maximum_path_approvals : Int
    release_note_required : Bool
    release_note_present : Bool
    } derive(Eq,
    Debug
    )

    ReviewPlan::approved_owners

    fn ReviewPlan::approved_owners(self : ReviewPlan) -> Array[String]

    ReviewPlan::has_release_note

    fn ReviewPlan::has_release_note(self : ReviewPlan) -> Bool

    ReviewPlan::maximum_path_approvals

    fn ReviewPlan::maximum_path_approvals(self : ReviewPlan) -> Int

    ReviewPlan::missing_labels

    fn ReviewPlan::missing_labels(self : ReviewPlan) -> Array[String]

    ReviewPlan::passed_checks

    fn ReviewPlan::passed_checks(self : ReviewPlan) -> Array[String]

    ReviewPlan::present_labels

    fn ReviewPlan::present_labels(self : ReviewPlan) -> Array[String]

    ReviewPlan::required_checks

    fn ReviewPlan::required_checks(self : ReviewPlan) -> Array[String]

    ReviewPlan::required_labels

    fn ReviewPlan::required_labels(self : ReviewPlan) -> Array[String]

    ReviewPlan::required_owners

    fn ReviewPlan::required_owners(self : ReviewPlan) -> Array[String]

    ReviewPlan::requires_release_note

    fn ReviewPlan::requires_release_note(self : ReviewPlan) -> Bool

    ReviewPlan::to_json

    fn ReviewPlan::to_json(self : ReviewPlan) -> String

    ReviewPlan::to_text

    fn ReviewPlan::to_text(self : ReviewPlan) -> String

    ReviewPlan::touched_rules

    fn ReviewPlan::touched_rules(self : ReviewPlan) -> Array[String]

    ReviewPlan::unapproved_owners

    fn ReviewPlan::unapproved_owners(self : ReviewPlan) -> Array[String]

    ReviewPlan::unresolved_checks

    fn ReviewPlan::unresolved_checks(self : ReviewPlan) -> Array[String]

    StringDelta

    pub struct StringDelta {
    added : Array[String]
    removed : Array[String]
    } derive(Eq,
    Debug
    )

    StringDelta::added

    fn StringDelta::added(self : StringDelta) -> Array[String]

    StringDelta::changed

    fn StringDelta::changed(self : StringDelta) -> Bool

    StringDelta::removed

    fn StringDelta::removed(self : StringDelta) -> Array[String]

    StringDelta::to_json

    fn StringDelta::to_json(self : StringDelta) -> String

    change_set_from_unified_diff

    fn change_set_from_unified_diff(id : String, evidence : Evidence, source : String) -> Result[ChangeSet, Diagnostic]

    changes_from_unified_diff

    fn changes_from_unified_diff(source : String) -> Result[Array[Change], Diagnostic]

    compare_policies

    fn compare_policies(before : Policy, after : Policy, paths : Array[String]) -> Result[PolicyComparison, Diagnostic]

    evaluate

    fn evaluate(policy : Policy, changes : ChangeSet) -> AuditReport

    execute

    fn execute(args : Array[String]) -> CommandResult

    lint_policy

    fn lint_policy(policy : Policy) -> LintReport

    parse_manifest

    fn parse_manifest(source : String) -> Result[ChangeSet, Diagnostic]

    parse_policy

    fn parse_policy(source : String) -> Result[Policy, Diagnostic]

    parse_review_evidence

    fn parse_review_evidence(source : String) -> Result[ReviewEvidence, Diagnostic]