BagIt 1.0 archive package creation and validation for MoonBit
moon check --target js
moon test --target js
moon build --target js
node bin/moonbagit.mjs create examples/payload example-bag --both --metadata examples/metadata.json
node bin/moonbagit.mjs validate example-bagexample-bag/
bagit.txt
bag-info.txt
manifest-sha256.txt
manifest-sha512.txt
tagmanifest-sha256.txt
tagmanifest-sha512.txt
data/
readme.txt
nested/measurement.csvmoon add zbhzs1/moonbagit@0.1.0moon run examples/core --target wasm-gc| Area | Current behavior |
|---|---|
| Declaration | BagIt 1.0, UTF-8 only; exact field order; no BOM |
| Payload manifests | SHA-256 and SHA-512; every manifest covers every payload file exactly once |
| Tag manifests | Required payload-manifest coverage; forbid payload and tag-manifest references; check listed arbitrary tags |
| Metadata | Ordered/repeated fields, continuations; unique and numeric Payload-Oxum |
| Paths | / separators, normative %25, %0D, %0A; no traversal, absolute, NUL, drive or backslash paths |
| Checksums | Verify every supported manifest, including all tag manifests |
| Fetch | Parse and check local coverage/length; missing remote files remain incomplete; no download or URI execution |
| Additional tags | Opaque content; verify if listed; unprotected tags produce warnings |
| Host safety | Reject symlinks and special files; no source overwrite; new output only |
| Receiving profiles | BagIt Profiles 1.4.0 rules for metadata, algorithms, fetch, files/directories and directory serialization constraints |
| Digest upgrade | Add supported manifests to a new output; retain payload, metadata and existing payload manifests; regenerate every tag manifest |
| Portability lint | Advisory device-name, trailing-character, case-collision and path-length diagnostics |
node bin/moonbagit.mjs create examples/payload research-bag --both --metadata examples/research-metadata.json
node bin/moonbagit.mjs validate research-bag --profile examples/research-profile.json
node bin/moonbagit.mjs lint research-bag
node bin/moonbagit.mjs create examples/payload sha256-bag --sha256
node bin/moonbagit.mjs upgrade sha256-bag upgraded-bag --sha512
node bin/moonbagit.mjs validate upgraded-bagmoon test --target js
moon test --target wasm-gc
python -m pip install bagit==1.9.0
python scripts/interop.py
git -c core.autocrlf=false clone https://github.com/LibraryOfCongress/bagit-conformance-suite.git ../bagit-conformance-suite
git -C ../bagit-conformance-suite checkout 9ab48705c06664f9f419ca740c728c9f89a61e7c
python scripts/conformance.py ../bagit-conformance-suite
python scripts/benchmark.py --files 10000 --bytes 1024pub(all) struct Profile {
identifier : String
version : String
metadata : Array[MetadataRule]
manifests_required : Array[String]
manifests_allowed : Array[String]?
tag_manifests_required : Array[String]
tag_manifests_allowed : Array[String]?
allow_fetch : Bool
require_fetch : Bool
data_empty : Bool
serialization : String
accepted_serializations : Array[String]
bag_versions : Array[String]
tags_required : Array[String]
tags_allowed : Array[String]
payload_required : Array[String]
payload_allowed : Array[String]
} derive(Debug)pub(all) struct ProfileReport {
conforms : Bool
bag : Report
diagnostics : Array[Diagnostic]
} derive(ToJson, Debug)pub(all) struct Report {
complete : Bool
valid : Bool
payload_files : Int
payload_bytes : Int64
verified_checksums : Int
diagnostics : Array[Diagnostic]
} derive(ToJson, Debug)fn create_tag_manifests(tags : Array[FileRecord], algorithms? : Array[Algorithm]) -> Map[String, String] raise FormatErrorfn create_tags(payload : Array[FileRecord], metadata? : Array[Metadata], algorithms? : Array[Algorithm]) -> Map[String, String] raise FormatErrorfn profile_path_matches(pattern : String, path : String) -> BoolInstall
Download zipBagIt 1.0 archive package creation and validation for MoonBit