Competition note: the GitHub repository is the primary open-source release
link for the 2026 MoonBit domestic open-source ecosystem contest. The GitLink
repository is kept as the contest platform mirror.
What It Does
MoonModGuard parses moon.mod and moon.pkg text, extracts module metadata and
package imports, builds an in-memory project model, evaluates supply-chain
policy risks, and renders a deterministic Markdown audit report.
The first version is deliberately dependency-free and accepts explicit strings
or snapshots instead of scanning the filesystem. This keeps the core portable
and testable while leaving room for later CI and workspace integrations.
Why This Exists
MoonBit projects rely on compact manifest files for package identity,
dependencies, metadata, and publication readiness. A small auditor can help
maintainers check whether a package is ready to publish, whether metadata is
complete, and whether dependency declarations match a local policy.
MoonModGuard targets software analysis and engineering quality workflows:
The parser handles the common MoonBit manifest shape used by package metadata
and import declarations. It is not a full MoonBit grammar parser. That boundary
is intentional: the first release focuses on release readiness and policy audit
checks that can be validated with stable tests.
The default policy accepts Apache-2.0, MIT, and MulanPSL-2.0, and treats
moonbitlang/ and python123/ as trusted dependency prefixes. Callers can pass
a custom Policy value for stricter project rules.
MoonModGuard
MoonModGuard is a MoonBit project manifest and supply-chain policy auditor.
What It Does
MoonModGuard parses
moon.modandmoon.pkgtext, extracts module metadata and package imports, builds an in-memory project model, evaluates supply-chain policy risks, and renders a deterministic Markdown audit report.The first version is deliberately dependency-free and accepts explicit strings or snapshots instead of scanning the filesystem. This keeps the core portable and testable while leaving room for later CI and workspace integrations.
Why This Exists
MoonBit projects rely on compact manifest files for package identity, dependencies, metadata, and publication readiness. A small auditor can help maintainers check whether a package is ready to publish, whether metadata is complete, and whether dependency declarations match a local policy.
MoonModGuard targets software analysis and engineering quality workflows:
Features
moon.mod:name,version,license,readme,repository,description.keywords = [ "audit", "moonbit" ].moon.modandmoon.pkg.Quick Start
Example CLI output:
API Example
Public API:
parse_mod(input : String) -> Result[ModuleManifest, GuardError]parse_pkg(input : String) -> Result[PackageManifest, GuardError]project_from(manifest : ModuleManifest, packages : Array[PackageManifest]) -> ProjectModelscan_project(snapshot : ProjectSnapshot) -> AuditReportdefault_policy() -> Policyevaluate_policy(project : ProjectModel, policy : Policy) -> AuditReportrender_markdown(report : AuditReport) -> Stringformat_error(err : GuardError) -> StringDesign Notes
The parser handles the common MoonBit manifest shape used by package metadata and import declarations. It is not a full MoonBit grammar parser. That boundary is intentional: the first release focuses on release readiness and policy audit checks that can be validated with stable tests.
The default policy accepts
Apache-2.0,MIT, andMulanPSL-2.0, and treatsmoonbitlang/andpython123/as trusted dependency prefixes. Callers can pass a customPolicyvalue for stricter project rules.Competition Materials
docs/competition/proposal.mddocs/competition/submission-guide.mddocs/competition/acceptance-checklist.mddocs/competition/MoonModGuard项目申报书.pdfLicense
Apache-2.0