Identity-based file delivery planning and independent plan auditing, with Windows portability checks.
moonportcheck plan examples/delivery/swap/spec.json --format json
moonportcheck audit-plan examples/delivery/swap/spec.json plan.json --format markdownresults/A.csv + results/a.csv → PATH_CASE_COLLISION
assets/CON.txt → NAME_RESERVED
notes/report.md. → NAME_TRAILING_DOT_SPACEpwsh -File scripts/toolchain.ps1 -Install
pwsh -File run_build.ps1
node bin/moonportcheck.mjs --version
node bin/moonportcheck.mjs check examples/windows-problems.json --format textbash scripts/toolchain.sh install
bash run_build.sh
node bin/moonportcheck.mjs --version
node bin/moonportcheck.mjs check examples/windows-problems.json --format textmoonportcheck scan ROOT [--config FILE] [--exclude PATTERN]... [--baseline FILE] [--fail-on new] [--format text|json|markdown|sarif]
moonportcheck snapshot ROOT [--config FILE] [--exclude PATTERN]...
moonportcheck check MANIFEST [--config FILE] [--exclude PATTERN]... [--format text|json|markdown|sarif]
moonportcheck diff BEFORE.json AFTER.json [--format text|json|markdown]
moonportcheck baseline create REPORT.json
moonportcheck rules [--format text|json]
moonportcheck explain CODE [--format text|json]
moonportcheck --help
moonportcheck --version# 实际目录:包含隐藏项,输出相对于根目录的路径。
node bin/moonportcheck.mjs scan ./delivery --format text
# 清单:可在 Windows 上预检本机无法创建的 Linux 文件名。
node bin/moonportcheck.mjs check examples/windows-problems.json --format json[
{ "path": "README.md", "kind": "file" },
{ "path": "results/实验记录.csv", "kind": "file" }
]{ "schema_version": 1, "exclude": ["**/cache", "*.tmp"] }| 退出码 | 含义 |
|---|---|
| 0 | 检查完整,已覆盖规则未发现问题 |
| 1 | 检查完整,存在路径或冲突问题 |
| 2 | 参数、编码或清单结构错误 |
| 3 | I/O 失败或扫描不完整,优先于 1 |
| 接口 | 用途 |
|---|---|
| EntryKind:File / Directory | 路径条目类型 |
| PathEntry:path、kind | 输入条目 |
| parse_manifest(String) | 返回 Result[Array[PathEntry], InputError] |
| audit(Array[PathEntry]) | 返回结构化 Report |
| render_json(Report) | 生成 JSON 报告 |
| render_text(Report) | 生成可读文本报告 |
pwsh -File run_demo.ps1
pwsh -File run_check.ps1
pwsh -File run_acceptance.ps1bash run_demo.sh
bash run_check.sh
bash run_acceptance.sh| 演示文件 | 展示内容 | 预期退出码 |
|---|---|---|
| portable.json | 中文、空格、点开头名称正常通过 | 0 |
| windows-problems.json | 大小写冲突、设备保留名、尾点 | 1 |
| hierarchy-conflicts.json | 三次重复、隐含目录大小写冲突、文件与目录冲突 | 1 |
moonportcheck rules --format json
moonportcheck explain NAME_RESERVEDpub struct AuditOptions {
// private fields
}pub struct Baseline {
format : String
schema_version : Int
profile : String
rules_version : String
scope : Array[String]
groups : Array[BaselineGroup]
} derive(Eq, Debug)pub struct BaselineChange {
code : String
anchor : String
status : BaselineStatus
members : Array[SourceMember]
source_total : Int
} derive(Eq, Debug)pub struct BaselineGroup {
code : String
anchor : String
members : Array[SourceMember]
source_total : Int
} derive(Eq, Debug)pub(all) struct DeliveryAudit {
status : String
valid : Bool
first_failed_step : Int
diagnostics : Array[DeliveryDiagnostic]
final_entries : Array[DeliveryStateEntry]
trace : Array[DeliveryTrace]
} derive(Eq, Debug)pub(all) struct DeliveryOperation {
kind : String
source : String
from : String
to : String
origin : DeliveryOrigin
} derive(Eq, Debug)pub(all) struct DeliveryPlan {
status : String
basis : String
operations : Array[DeliveryOperation]
temporary_paths : Array[String]
diagnostics : Array[DeliveryDiagnostic]
} derive(Eq, Debug)pub(all) struct DeliverySpec {
sources : Array[DeliveryTree]
target : DeliveryTree
mappings : Array[DeliveryMapping]
} derive(Eq, Debug)pub(all) struct DeliveryStateEntry {
path : String
kind : EntryKind
origin : DeliveryOrigin
} derive(Eq, Debug)pub(all) struct DeliveryTrace {
step : Int
kind : String
from : String
to : String
origin : DeliveryOrigin
} derive(Eq, Debug)pub(all) struct DetailedDiagnostic {
code : String
severity : String
paths : Array[String]
occurrences : Int
message : String
anchor : String
group_key : String
members : Array[SourceMember]
source_examples : Array[SourceMember]
source_total : Int
sources_truncated : Bool
} derive(Eq, Debug)pub(all) struct DetailedReport {
schema_version : Int
profile : String
source : String
complete : Bool
summary : Summary
diagnostics : Array[DetailedDiagnostic]
limitations : Array[String]
scan_issues : Array[ScanIssue]
scope : Array[String]
excluded_entries : Int
pruned_directories : Array[String]
} derive(Eq, Debug)pub struct ExclusionScope {
// private fields
}pub struct PathPattern {
// private fields
}fn audit_snapshot(snapshot : Snapshot, extra_scope : Array[String]) -> Result[DetailedReport, InputError]fn audit_with_exclusions(entries : Array[PathEntry], options : AuditOptions, scope : ExclusionScope) -> DetailedReportfn rules_version() -> Stringfn uri_escape_path(value : String) -> StringInstall
Download zipIdentity-based file delivery planning and independent plan auditing, with Windows portability checks.