MoonBit test adequacy and release quality gate toolkit.
curl -fsSL https://cli.moonbitlang.com/install/unix.sh | bash
export PATH="$HOME/.moon/bin:$PATH"
moon version --allSet-ExecutionPolicy RemoteSigned -Scope CurrentUser
irm https://cli.moonbitlang.com/install/powershell.ps1 | iex
$env:Path = "$env:USERPROFILE\.moon\bin;$env:Path"
moon version --allgit clone https://github.com/LL728/moonseal.git
cd moonsealmoon check --target js
moon build --target js
moon fmt --check
moon info
git diff --exit-code
moon test --target jsmoon run --target js cmd/main -- scan fixtures/well_tested
moon run --target js cmd/main -- gate fixtures/well_tested
moon run --target js cmd/main -- gate fixtures/untested
moon run --target js cmd/main -- mutants fixtures/mutation_targets
moon run --target js cmd/main -- explain fixtures/well_tested
moon run --target js cmd/main -- api fixtures/well_tested
moon run --target js cmd/main -- manifest fixtures/well_testedmoon run --target js cmd/main -- scan fixtures/well_tested --mutate --coverage
moon run --target js cmd/main -- gate fixtures/well_tested --mutate --coveragemoon run --target js cmd/main -- snapshot . --output moonseal-baseline.json
moon run --target js cmd/main -- compare . --baseline moonseal-baseline.json
moon run --target js cmd/main -- recommend .moon run --target js cmd/main -- sarif . --output moonseal.sarifmoon run --target js cmd/main -- api .
moon run --target js cmd/main -- trend . --history _build/quality-history.json
moon run --target js cmd/main -- manifest . --output _build/release-manifest.json{
"min_project_tests": 5,
"require_package_tests": true,
"require_tests_for_mutants": true,
"require_readme": true,
"require_license": true,
"require_ci": true,
"min_mutation_score": 60,
"min_coverage": 70
}pub(all) struct ApiCoverage {
entries : Array[ApiCoverageEntry]
summary : ApiCoverageSummary
} derive(Eq)impl ToJson for ApiCoverageimpl ToJson for ApiCoverageEntrypub(all) struct ApiCoverageSummary {
total : Int
covered : Int
uncovered : Int
percentage : Int
} derive(Eq)impl ToJson for ApiCoverageSummarypub(all) struct ExternalCoverage {
format : String
total : Int
covered : Int
percentage : Int
files : Array[FileCoverage]
} derive(Eq)impl ToJson for ExternalCoveragepub(all) struct GatePolicy {
min_project_tests : Int
require_package_tests : Bool
require_tests_for_mutants : Bool
require_readme : Bool
require_license : Bool
require_ci : Bool
min_mutation_score : Int
min_coverage : Int
} derive(Eq)pub(all) struct ModuleMeta {
name : String
version : String
readme : String
repository : String
license : String
} derive(Eq)pub(all) struct MutationCandidate {
id : String
path : String
line : Int
kind : String
original : String
replacement : String
} derive(Eq)impl ToJson for MutationCandidatepub(all) struct PackageSnapshot {
path : String
source_count : Int
test_count : Int
public_api_count : Int
warning_count : Int
} derive(Eq)impl ToJson for PackageSnapshotpub(all) struct QualityDashboard {
project : String
version : String
score : Int
label : String
source_files : Int
test_files : Int
package_count : Int
mutation_candidates : Int
mutation_score : Int
coverage_percentage : Int
warning_count : Int
recommendation_count : Int
risks : Array[String]
} derive(Eq)impl ToJson for QualityDashboardpub(all) struct QualityHistory {
schema_version : Int
snapshots : Array[QualitySnapshot]
} derive(Eq)impl ToJson for QualityHistorypub(all) struct QualityRecommendation {
id : String
priority : String
title : String
detail : String
} derive(Eq)impl ToJson for QualityRecommendationpub(all) struct QualityReport {
name : String
version : String
readme : String
repository : String
license : String
packages : Array[PackageQuality]
imports : Array[ImportInfo]
source_files : Array[SourceFile]
test_files : Array[TestFile]
mutation_candidates : Array[MutationCandidate]
warnings : Array[String]
mutation_score : Int
mutants_killed : Int
mutants_tested : Int
survived_mutants : Array[MutationCandidate]
coverage_total_percentage : Int
coverage_files : Array[FileCoverage]
} derive(Eq)impl ToJson for QualityReportpub(all) struct QualitySnapshot {
schema_version : Int
name : String
version : String
source_files : Int
test_files : Int
package_count : Int
mutation_candidates : Int
mutants_tested : Int
mutation_score : Int
coverage_total_percentage : Int
warning_count : Int
packages : Array[PackageSnapshot]
} derive(Eq)impl ToJson for QualitySnapshotimpl ToJson for ReleaseCheckpub(all) struct ReleaseManifest {
schema_version : Int
project : String
version : String
repository : String
source_files : Int
test_files : Int
api_coverage : Int
gate_passed : Bool
failed_checks : Int
checks : Array[ReleaseCheck]
} derive(Eq)impl ToJson for ReleaseManifestpub(all) enum SealError {
MissingProject(String)
MissingManifest(String)
FileReadFailed(String)
} derive(Eq)pub(all) struct SnapshotComparison {
passed : Bool
baseline_version : String
current_version : String
deltas : Array[SnapshotDelta]
regressions : Array[SnapshotRegression]
improvements : Array[SnapshotDelta]
summary : String
} derive(Eq)impl ToJson for SnapshotComparisonpub(all) struct SnapshotDelta {
metric : String
baseline : Int
current : Int
delta : Int
direction : String
} derive(Eq)impl ToJson for SnapshotDeltapub(all) struct SnapshotRegression {
metric : String
baseline : Int
current : Int
delta : Int
message : String
} derive(Eq)impl ToJson for SnapshotRegressionpub(all) struct SourceFile {
path : String
package_path : String
is_test : Bool
digest : String
mutation_points : Int
} derive(Eq)impl ToJson for SourceFilepub(all) struct TrendReport {
sample_count : Int
first_version : String
latest_version : String
source_file_delta : Int
test_file_delta : Int
mutation_score_delta : Int
coverage_delta : Int
warning_delta : Int
direction : String
} derive(Eq)impl ToJson for TrendReportfn health_label(score : Int) -> Stringfn make_release_manifest(report : QualityReport, gate : GateResult, api : ApiCoverage) -> ReleaseManifestfn run_mutation_testing(root : String, candidates : Array[MutationCandidate]) -> (Int, Int, Int, Array[MutationCandidate])fn write_text(path : String, content : String) -> Result[Unit, String]MoonBit test adequacy and release quality gate toolkit.