Deterministic resource lockfile and integrity manifest toolkit for MoonBit asset pipelines.
moon add WSH-ai-nb/reslockimport {
"WSH-ai-nb/reslock" @reslock
}let style = @reslock.asset(
"public\\css\\app.css",
"body{color:#24313f}",
kind=@reslock.Text,
tags=["css", "critical"],
).unwrap()
let manifest = @reslock.manifest("site-assets", "1.0.0", [style])
let lockfile = @reslock.render_manifest(manifest)
let parsed = @reslock.parse_manifest(lockfile).unwrap()
let summary = @reslock.summarize(parsed)
println(summary.manifest_fingerprint)moon check
moon build
moon test
moon run cmd/mainmoon check
moon build
moon test
moon run cmd/main
moon publish --dry-runWSH-ai-nb/reslockpub(all) struct Asset {
path : String
kind : AssetKind
bytes : Int
fingerprint : String
policy : CachePolicy
tags : Array[String]
note : String?
} derive(Eq)pub(all) enum AssetBucket {
BucketSource
BucketDocument
BucketConfig
BucketMedia
BucketArchive
BucketGenerated
BucketRuntime
BucketOther
} derive(Eq)pub(all) struct CachePlan {
path : String
current : CachePolicy
recommended : CachePolicy
tier : CacheTier
aligned : Bool
reason : String
} derive(Eq)pub(all) enum CacheTier {
CacheStable
CacheRefreshable
CacheTransient
CacheCallerManaged
} derive(Eq)pub(all) struct DirectoryProfile {
directory : String
entries : Int
bytes : Int
generated_entries : Int
runtime_entries : Int
media_entries : Int
source_entries : Int
document_entries : Int
warnings : Int
} derive(Eq)pub(all) struct Finding {
level : FindingLevel
code : String
path : String?
message : String
} derive(Eq)pub(all) struct PolicyAdvice {
path : String
current : CachePolicy
recommended : CachePolicy
reason : String
} derive(Eq)pub(all) struct PolicyProfile {
total : Int
immutable : Int
revalidate : Int
no_store : Int
runtime : Int
aligned : Int
misaligned : Int
stability_score : Int
immutable_bytes : Int
revalidate_bytes : Int
no_store_bytes : Int
runtime_bytes : Int
} derive(Eq)pub(all) struct QualityReport {
score : Int
risk : RiskLevel
entries : Int
total_bytes : Int
errors : Int
warnings : Int
generated_assets : Int
runtime_assets : Int
no_store_assets : Int
immutable_assets : Int
missing_tag_assets : Int
oversized_assets : Int
duplicate_fingerprint_assets : Int
directory_count : Int
extension_count : Int
policy_advice : Array[PolicyAdvice]
findings : Array[Finding]
} derive(Eq)pub(all) struct ReleaseDelta {
added : Int
removed : Int
changed : Int
byte_delta : Int
policy_changes : Int
kind_changes : Int
fingerprint_changes : Int
tag_changes : Int
impact : ReleaseImpact
} derive(Eq)pub(all) struct ReleaseGate {
min_score : Int
allow_warnings : Bool
max_warnings : Int
max_entries : Int
max_total_bytes : Int
max_asset_bytes : Int
require_tags : Bool
forbid_runtime : Bool
forbid_no_store : Bool
require_readme_asset : Bool
require_license_asset : Bool
} derive(Eq)pub(all) struct ReleaseGateResult {
decision : ReleaseDecision
quality : QualityReport
blockers : Array[String]
warnings : Array[String]
notes : Array[String]
} derive(Eq)pub(all) enum ReslockError {
EmptyPath
AbsolutePath(String)
ParentTraversal(String)
InvalidPathSegment(String)
InvalidTag(String)
InvalidFingerprint(String)
DuplicatePath(String)
MissingHeader
InvalidLine(Int, String)
InvalidEscape(String)
BadNumber(String)
UnknownKind(String)
UnknownPolicy(String)
} derive(Eq)pub(all) struct SealSummary {
entries : Int
total_bytes : Int
manifest_fingerprint : String
errors : Int
warnings : Int
} derive(Eq)fn asset(path : String, content : String, kind? : AssetKind, policy? : CachePolicy, tags? : Array[String], note? : String) -> Result[Asset, ReslockError]fn gate_with_size_budget(gate : ReleaseGate, max_total_bytes : Int, max_asset_bytes : Int) -> ReleaseGatefn release_impact(added : Int, removed : Int, changed : Int, policy_changes : Int, kind_changes : Int) -> ReleaseImpactfn sealed_asset(path : String, kind : AssetKind, bytes : Int, fingerprint : String, policy : CachePolicy, tags? : Array[String], note? : String) -> Result[Asset, ReslockError]Deterministic resource lockfile and integrity manifest toolkit for MoonBit asset pipelines.