README

wch6766/MoonSecureCodec/lib/manifest does not have a README file

#
ApprovalGate

pub(all) struct ApprovalGate {
policy : ReleasePolicy
require_clean_report : Bool
}

A release gate that requires both technical and human approval.

#
ApprovalGate::evaluate

fn ApprovalGate::evaluate(self : ApprovalGate, manifest : Manifest, approval : ApprovalRecord?) -> Bool

Check policy and approval evidence together.

#
ApprovalGate::strict

fn ApprovalGate::strict() -> ApprovalGate

Construct a strict gate for a public package release.

#
ApprovalRecord

pub(all) struct ApprovalRecord {
reviewer : String
ticket : String
reviewed_root : String
approved_at : String
notes : String
}

Approval metadata attached to a release review.

#
ApprovalRecord::matches

fn ApprovalRecord::matches(self : ApprovalRecord, manifest : Manifest) -> Bool

Validate that an approval refers to the exact manifest root under review.

#
ApprovalRecord::to_text

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

Return a stable serialized approval line for audit logs.

#
AuditFinding

pub(all) struct AuditFinding {
code : String
severity : AuditSeverity
path : String
message : String
remediation : String
}

A deterministic, machine-readable audit finding.

#
AuditReport

pub(all) struct AuditReport {
findings : Array[AuditFinding]
files_checked : Int
total_bytes : Int64
}

Result of validating a manifest against structural and supply-chain rules.

#
AuditReport::count

fn AuditReport::count(self : AuditReport, severity : AuditSeverity) -> Int

Count findings at a given severity.

#
AuditReport::decision

fn AuditReport::decision(self : AuditReport) -> ReleaseDecision

Convert a manifest audit report into an explicit release decision.

#
AuditReport::error_codes

fn AuditReport::error_codes(self : AuditReport) -> Array[String]

Return all error codes in insertion order.

#
AuditReport::findings

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

Return the findings in insertion order for integrations that need structured data.

#
AuditReport::has_errors

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

Return true when the report contains a blocking finding.

#
AuditReport::is_clean

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

Return true only when the report has no findings at all.

#
AuditReport::to_text

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

Format the report as stable text suitable for CI logs.

#
AuditSeverity

pub(all) enum AuditSeverity {
Info
Warning
Error
} derive(Eq,
Debug
)

Severity assigned to a manifest audit finding.

#
Dependency

pub(all) struct Dependency {
name : String
version : String
license : String
source : String
digest : String
}

A dependency record used to audit an SBOM-like manifest.

#
DependencyAudit

pub(all) struct DependencyAudit {
dependencies_checked : Int
findings : Array[AuditFinding]
}

A dependency audit result with actionable findings.

#
DependencyAudit::count

fn DependencyAudit::count(self : DependencyAudit, severity : AuditSeverity) -> Int

Count dependency findings by severity.

#
DependencyAudit::error_dependencies

fn DependencyAudit::error_dependencies(self : DependencyAudit) -> Array[String]

Return the names of dependencies whose metadata contains blocking errors.

#
DependencyAudit::has_errors

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

Return whether the dependency audit has a blocking finding.

#
DependencyAudit::summary

fn DependencyAudit::summary(self : DependencyAudit) -> String

Format dependency audit counts for release evidence.

#
EvidenceBundle

pub(all) struct EvidenceBundle {
name : String
version : String
manifest_root : String
records : Array[EvidenceRecord]
bundle_digest : String
}

A deterministic evidence bundle bound to one manifest root.

#
EvidenceBundle::add

fn EvidenceBundle::add(self : EvidenceBundle, record : EvidenceRecord) -> Unit

Append one record and refresh the bundle digest.

#
EvidenceBundle::binds_to

fn EvidenceBundle::binds_to(self : EvidenceBundle, manifest : Manifest) -> Bool

Return true when the bundle names the exact manifest being reviewed.

#
EvidenceBundle::canonical_text

fn EvidenceBundle::canonical_text(self : EvidenceBundle) -> String

Return the canonical header and record lines used for hashing.

#
EvidenceBundle::count_kind

fn EvidenceBundle::count_kind(self : EvidenceBundle, kind : EvidenceKind) -> Int

Count records belonging to one evidence kind.

#
EvidenceBundle::digest

fn EvidenceBundle::digest(self : EvidenceBundle) -> String

Return the stored digest of the evidence bundle.

#
EvidenceBundle::duplicate_ids

fn EvidenceBundle::duplicate_ids(self : EvidenceBundle) -> Array[String]

Return duplicate record identifiers in first-seen order.

#
EvidenceBundle::find

fn EvidenceBundle::find(self : EvidenceBundle, id : String) -> EvidenceRecord?

Find an evidence record by its stable identifier.

#
EvidenceBundle::has_kind

fn EvidenceBundle::has_kind(self : EvidenceBundle, kind : EvidenceKind) -> Bool

Return true when at least one record of the requested kind is present.

#
EvidenceBundle::is_complete

fn EvidenceBundle::is_complete(self : EvidenceBundle) -> Bool

Return true only when all standard release evidence is present.

#
EvidenceBundle::missing_kinds

fn EvidenceBundle::missing_kinds(self : EvidenceBundle, required : Array[EvidenceKind]) -> Array[EvidenceKind]

Return which required evidence kinds are absent.

#
EvidenceBundle::new

fn EvidenceBundle::new(name : String, version : String, manifest_root : String, records : Array[EvidenceRecord]) -> EvidenceBundle

Construct a bundle and calculate its digest immediately.

#
EvidenceBundle::record_count

fn EvidenceBundle::record_count(self : EvidenceBundle) -> Int

Return the number of evidence records in the bundle.

#
EvidenceBundle::records

Return the records in insertion order for audit integrations.

#
EvidenceBundle::refresh_digest

fn EvidenceBundle::refresh_digest(self : EvidenceBundle) -> Unit

Recompute and store the SHA-256 digest of the canonical evidence text.

#
EvidenceBundle::to_text

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

Format a compact audit summary suitable for a CI artifact.

#
EvidenceBundle::verify

fn EvidenceBundle::verify(self : EvidenceBundle) -> Bool

Verify digest, record validity, duplicate IDs, and manifest binding data.

#
EvidenceKind

pub(all) enum EvidenceKind {
Source
Dependency
Build
Test
Review
} derive(Eq,
Debug
)

The kind of evidence attached to a release review.

#
EvidenceKind::to_text

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

Return the stable wire name used for an evidence kind.

#
EvidenceRecord

pub(all) struct EvidenceRecord {
id : String
kind : EvidenceKind
subject : String
digest : String
observed_at : String
note : String
}

A single, content-addressed release evidence record.

#
EvidenceRecord::canonical_text

fn EvidenceRecord::canonical_text(self : EvidenceRecord) -> String

Serialize a record without a trailing newline for deterministic hashing.

#
EvidenceRecord::is_valid

fn EvidenceRecord::is_valid(self : EvidenceRecord) -> Bool

Validate fields before an evidence record is included in a bundle.

#
EvidenceRecord::new

fn EvidenceRecord::new(id : String, kind : EvidenceKind, subject : String, digest : String, observed_at : String, note : String) -> EvidenceRecord

Construct one evidence record. digest should be a lowercase SHA-256 hex digest of the referenced artifact, log, or review material.

#
FileSnapshot

pub(all) struct FileSnapshot {
path : String
size : Int64
hash_xx64 : UInt64
hash_sha256 : String
}

Represents a snapshot of a file or software dependency in the supply chain.

#
FileSnapshot::canonical_bytes

fn FileSnapshot::canonical_bytes(self : FileSnapshot) -> Bytes

Serialize a FileSnapshot to a canonical byte representation for Merkle tree hashing.

#
FileSnapshot::from_bytes

fn FileSnapshot::from_bytes(path : String, data : Bytes) -> FileSnapshot

Construct a FileSnapshot by inspecting raw file contents.

#
LicensePolicy

pub(all) struct LicensePolicy {
allowed_licenses : Array[String]
require_source : Bool
require_digest : Bool
allow_unknown_version : Bool
}

License and provenance policy for release dependency audits.

#
LicensePolicy::development

fn LicensePolicy::development() -> LicensePolicy

Construct a permissive policy for local development while retaining warnings.

#
LicensePolicy::strict

fn LicensePolicy::strict(allowed_licenses : Array[String]) -> LicensePolicy

Construct a strict policy suitable for a published package.

#
Manifest

pub(all) struct Manifest {
name : String
version : String
created_at : String
files : Array[FileSnapshot]
merkle_root : String
}

A Software Supply Chain Manifest (SBOM / Snapshot) with embedded Merkle root.

#
Manifest::approval_finding

fn Manifest::approval_finding(self : Manifest, approval : ApprovalRecord?) -> AuditFinding?

Return a finding when approval metadata is missing or stale.

#
Manifest::approval_payload

fn Manifest::approval_payload(self : Manifest) -> String

Return the exact root that an external signer should approve.

#
Manifest::audit

fn Manifest::audit(self : Manifest) -> AuditReport

Validate a manifest using the default conservative supply-chain policy.

The policy rejects ambiguous paths, duplicate paths, malformed hashes, and a stale Merkle root. It also warns about empty manifests and suspicious generated/build files that should normally be excluded from a release.

#
Manifest::audit_with_policy

fn Manifest::audit_with_policy(self : Manifest, allowed_extensions : Array[String], max_file_size : Int64) -> AuditReport

Apply a project-specific allow-list to file extensions and paths.

#
Manifest::compute_merkle_tree

Compute the Merkle tree for all files in this manifest.

#
Manifest::contains_only_extensions

fn Manifest::contains_only_extensions(self : Manifest, allowed : Array[String]) -> Bool

Return true when a manifest contains no files rejected by a policy.

#
Manifest::diff

fn Manifest::diff(self : Manifest, other : Manifest) -> ManifestDiff

Compare two manifests (self as old/baseline, other as new) to find added, removed, and modified files.

#
Manifest::evidence_bundle

fn Manifest::evidence_bundle(self : Manifest, records : Array[EvidenceRecord]) -> EvidenceBundle

Construct evidence metadata directly from the manifest under review.

#
Manifest::files_under

fn Manifest::files_under(self : Manifest, directory : String) -> Array[FileSnapshot]

Return all snapshots whose path begins with a normalized directory prefix.

#
Manifest::find

fn Manifest::find(self : Manifest, path : String) -> FileSnapshot?

Find a snapshot by exact repository-relative path.

#
Manifest::has_complete_digests

fn Manifest::has_complete_digests(self : Manifest) -> Bool

Return true when every file in the manifest has a valid SHA-256 record.

#
Manifest::has_unique_paths

fn Manifest::has_unique_paths(self : Manifest) -> Bool

Validate that all snapshot paths are unique without creating a full report.

#
Manifest::is_release_ready

fn Manifest::is_release_ready(self : Manifest, policy : ReleasePolicy) -> Bool

Return a compact policy result suitable for a CI exit decision.

#
Manifest::is_source_release_ready

fn Manifest::is_source_release_ready(self : Manifest) -> Bool

Validate a manifest against the default source-package policy.

#
Manifest::merge

fn Manifest::merge(self : Manifest, other : Manifest) -> Manifest

Merge two manifests while keeping the newer snapshot for duplicate paths. The operation is deterministic: the left manifest's order is retained and new paths from the right manifest are appended in their original order.

#
Manifest::missing_paths

fn Manifest::missing_paths(self : Manifest, required : Array[String]) -> Array[String]

Return paths that are missing from a required-path list.

#
Manifest::new

fn Manifest::new(name : String, version : String, created_at : String, files : Array[FileSnapshot]) -> Manifest

Construct a new supply chain Manifest and automatically compute its Merkle root.

#
Manifest::refresh_merkle_root

fn Manifest::refresh_merkle_root(self : Manifest) -> Unit

Recalculate and update the merkle_root property of the manifest.

#
Manifest::release_check

fn Manifest::release_check(self : Manifest, policy : ReleasePolicy) -> AuditReport

Validate a manifest against a release policy and append policy findings.

#
Manifest::release_decision

fn Manifest::release_decision(self : Manifest, policy : ReleasePolicy) -> ReleaseDecision

Convert a policy check directly into a release decision.

#
Manifest::select_batch

fn Manifest::select_batch(self : Manifest, start : Int, limit : Int) -> Result[ManifestSelection, String]

Select a bounded batch for parallel or resumable verification.

#
Manifest::select_directory

fn Manifest::select_directory(self : Manifest, directory : String) -> ManifestSelection

Select files below a repository-relative directory.

#
Manifest::select_large_files

fn Manifest::select_large_files(self : Manifest, minimum_bytes : Int64) -> ManifestSelection

Select files at least as large as a configured threshold.

#
Manifest::select_suffixes

fn Manifest::select_suffixes(self : Manifest, suffixes : Array[String]) -> ManifestSelection

Select files whose paths end in one of the supplied suffixes.

#
Manifest::statistics

fn Manifest::statistics(self : Manifest) -> ManifestStatistics

Calculate deterministic statistics without reading the original files again.

#
Manifest::submanifest

fn Manifest::submanifest(self : Manifest, directory : String) -> Manifest

Return a copy containing only files under the requested directory.

#
Manifest::summary

fn Manifest::summary(self : Manifest) -> String

Return a stable human-readable summary for release notes and CI artifacts.

#
Manifest::to_json_string

fn Manifest::to_json_string(self : Manifest) -> String

Serialize the Manifest into a human and machine readable JSON string.

#
Manifest::verify_integrity

fn Manifest::verify_integrity(self : Manifest) -> Bool

Verify whether the files currently in the manifest match the stored Merkle root.

#
ManifestDiff

pub(all) struct ManifestDiff {
added : Array[FileSnapshot]
removed : Array[FileSnapshot]
modified : Array[FileSnapshot]
}

Represents differences discovered between two supply chain manifests.

#
ManifestDiff::changed_files

fn ManifestDiff::changed_files(self : ManifestDiff) -> Array[FileSnapshot]

Return a manifest containing only changed files from a diff.

#
ManifestDiff::has_changes

fn ManifestDiff::has_changes(self : ManifestDiff) -> Bool

Return true if two manifests differ in any file content or path.

#
ManifestDiff::removed_paths

fn ManifestDiff::removed_paths(self : ManifestDiff) -> Array[String]

Return all paths in a diff that were removed from the newer release.

#
ManifestDiff::summary

fn ManifestDiff::summary(self : ManifestDiff) -> String

Format a diff in a stable form suitable for a change review.

#
ManifestSelection

pub(all) struct ManifestSelection {
files : Array[FileSnapshot]
total_bytes : Int64
source_manifest_root : String
}

A deterministic selection of manifest entries for incremental verification.

#
ManifestSelection::at

fn ManifestSelection::at(self : ManifestSelection, index : Int) -> FileSnapshot?

Return the selected snapshot at an index without exposing the backing array.

#
ManifestSelection::contains_path

fn ManifestSelection::contains_path(self : ManifestSelection, path : String) -> Bool

Return whether a selection contains an exact path.

#
ManifestSelection::file_count

fn ManifestSelection::file_count(self : ManifestSelection) -> Int

Return the number of selected files.

#
ManifestSelection::has_complete_digests

fn ManifestSelection::has_complete_digests(self : ManifestSelection) -> Bool

Return true when all selected snapshots have canonical digest records.

#
ManifestSelection::has_unique_paths

fn ManifestSelection::has_unique_paths(self : ManifestSelection) -> Bool

Return whether every selected path is unique.

#
ManifestSelection::is_empty

fn ManifestSelection::is_empty(self : ManifestSelection) -> Bool

Return true if a selection is empty.

#
ManifestSelection::is_zero_bytes

fn ManifestSelection::is_zero_bytes(self : ManifestSelection) -> Bool

Return whether the selection's byte total is zero.

#
ManifestSelection::largest

Return the largest selected file, if any.

#
ManifestSelection::merkle_root

fn ManifestSelection::merkle_root(self : ManifestSelection) -> String

Compute a Merkle root over selected canonical file snapshots.

#
ManifestSelection::min_max_bytes

fn ManifestSelection::min_max_bytes(self : ManifestSelection) -> (Int64, Int64)?

Return the inclusive total size range of selected files.

#
ManifestSelection::paths

fn ManifestSelection::paths(self : ManifestSelection) -> Array[String]

Return selected paths in stable manifest order.

#
ManifestSelection::slice

fn ManifestSelection::slice(self : ManifestSelection, start : Int, limit : Int) -> Result[ManifestSelection, String]

Return a bounded sub-selection while preserving source-root provenance.

#
ManifestSelection::source_is

fn ManifestSelection::source_is(self : ManifestSelection, manifest : Manifest) -> Bool

Verify that the selection still corresponds to the source manifest root.

#
ManifestSelection::to_text

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

Return a stable summary suitable for an incremental build log.

#
ManifestSelection::valid_sizes

Return a selection containing only files with non-negative sizes.

#
ManifestSelection::with_sha256

fn ManifestSelection::with_sha256(self : ManifestSelection, digest : String) -> Array[FileSnapshot]

Find selected files by their exact SHA-256 digest.

#
ManifestStatistics

pub(all) struct ManifestStatistics {
file_count : Int
total_bytes : Int64
largest_path : String
largest_bytes : Int64
sha256_count : Int
generated_count : Int
}

Aggregate release statistics derived from a manifest.

#
ReleaseDecision

pub(all) struct ReleaseDecision {
ready : Bool
risk_score : Int
errors : Int
warnings : Int
checked_files : Int
checked_bytes : Int64
}

Release decision with counts that can be exported to CI or a dashboard.

#
ReleaseDecision::exit_code

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

Return an exit code suitable for a CI shell wrapper.

#
ReleaseDecision::is_clean

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

Return true only when no warnings or errors remain.

#
ReleaseDecision::to_text

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

Return a compact stable line for a build summary.

#
ReleasePolicy

pub(all) struct ReleasePolicy {
max_files : Int
max_total_bytes : Int64
required_paths : Array[String]
allowed_extensions : Array[String]
max_file_bytes : Int64
reject_generated : Bool
}

Release policy for CI and package publication gates.

#
ReleasePolicy::source_package

fn ReleasePolicy::source_package() -> ReleasePolicy

Construct a conservative release policy for source packages.

#
audit_dependencies

fn audit_dependencies(dependencies : Array[Dependency], policy : LicensePolicy) -> DependencyAudit

Audit dependency metadata independently from file integrity.

#
release_evidence_kinds

fn release_evidence_kinds() -> Array[EvidenceKind]

The conservative evidence set expected for a public release.

#
snapshots_equal

fn snapshots_equal(left : FileSnapshot, right : FileSnapshot) -> Bool

Return true when two snapshots have identical cryptographic content.

Powered by MoonBit

Site sourceReport issuePackagesBuild queueSkillsStatistics

© 2026 mooncakes.io