GerberGuard-MBT is a lightweight Gerber PCB manufacturing file
inspection and preflight tool implemented in MoonBit.
It scans Gerber command streams, extracts format, unit and X2 metadata,
tracks aperture definitions and graphics state, validates common
structural relationships such as undefined apertures, region state,
plot state and end-of-file markers, and produces deterministic text or
JSON reports.
Version 0.1.0 intentionally implements a limited modern Gerber subset.
It does not render PCB geometry or attempt full manufacturing-rule
verification. The project focuses on a small, reliable and testable
core suitable for command-line use and CI pipelines.
GerberGuard 0.1.0 implements a deliberately limited subset of the
Gerber Layer Format.
It is intended for inspection and basic preflight checks.
It is not a complete Gerber conformance checker, renderer, PCB DRC
engine, or CAM system.
GerberGuard focuses on a small but useful task: deterministic,
offline preflight inspection of Gerber manufacturing files.
Instead of rendering geometry, it checks the command stream and
graphics-state relationships, making the implementation compact,
testable and suitable for automated CI pipelines.
Contribution scope and the required local workflow are documented in
CONTRIBUTING.md. Security and private-fixture reporting
guidance is documented in SECURITY.md.
Release and Mooncakes publication steps are documented in
docs/RELEASING.md.
moon fmt
moon check --target all --deny-warn
moon test --target all --deny-warn
moon build --release --target native
moon info
git diff --ignore-blank-lines --exit-code -- pkg.generated.mbti cmd/main/pkg.generated.mbti
Testing
Unit tests cover scanner, parser, checker, reporters and CLI parsing.
Fixtures live under samples/pass, samples/warn and samples/fail.
The complete reproducible acceptance procedure is in
ACCEPTANCE.md.
GerberGuard v0.1.0 is a Gerber supported-subset preflight checker.
It performs structural inspection only.
Gerber Specification Reference
This project targets a practical modern subset of the Gerber Layer Format
(Ucamco), especially common X2 attributes and graphics-state commands used
in manufacturing handoff files.
Source, fixture, generated-file, dependency, and AI-assistance disclosures are
documented in docs/PROVENANCE.md.
GerberGuard-MBT
GerberGuard-MBT is a lightweight Gerber PCB manufacturing file inspection and preflight tool implemented in MoonBit.
It scans Gerber command streams, extracts format, unit and X2 metadata, tracks aperture definitions and graphics state, validates common structural relationships such as undefined apertures, region state, plot state and end-of-file markers, and produces deterministic text or JSON reports.
Version 0.1.0 intentionally implements a limited modern Gerber subset. It does not render PCB geometry or attempt full manufacturing-rule verification. The project focuses on a small, reliable and testable core suitable for command-line use and CI pipelines.
GerberGuard 0.1.0 implements a deliberately limited subset of the Gerber Layer Format.
It is intended for inspection and basic preflight checks.
It is not a complete Gerber conformance checker, renderer, PCB DRC engine, or CAM system.
GerberGuard-MBT 是一个使用 MoonBit 编写的轻量级 PCB Gerber 制造文件检查与预检工具。它读取 Gerber 命令流,提取单位、坐标格式、Aperture 和部分 X2 文件属性,并检查常见结构问题。项目不渲染 PCB 图形,不进行 DRC,也不判断 PCB 是否可以生产。
GerberGuard focuses on a small but useful task: deterministic, offline preflight inspection of Gerber manufacturing files.
Instead of rendering geometry, it checks the command stream and graphics-state relationships, making the implementation compact, testable and suitable for automated CI pipelines.
Features
Supported Syntax
See docs/SUPPORTED_SYNTAX.md.
What GerberGuard Does Not Do
GerberGuard does not:
Installation
Requires a MoonBit toolchain with Native support.
The published Mooncakes package is
001-Elsa/gerberguard@0.1.0:To build the native CLI from source:
Usage
After
moon build --release --target native, the executable can also be invoked asgerberguarddepending on your packaging/install path.inspect example
check example
JSON example
The JSON mode writes one JSON document to stdout without banners or debug logs.
Exit Codes
Error Model
Deterministic issue codes are documented in docs/ERROR_CODES.md.
Development
Contribution scope and the required local workflow are documented in CONTRIBUTING.md. Security and private-fixture reporting guidance is documented in SECURITY.md. Release and Mooncakes publication steps are documented in docs/RELEASING.md.
Testing
Unit tests cover scanner, parser, checker, reporters and CLI parsing. Fixtures live under
samples/pass,samples/warnandsamples/fail. The complete reproducible acceptance procedure is in ACCEPTANCE.md.Project Structure
Limitations
GerberGuard v0.1.0 is a Gerber supported-subset preflight checker. It performs structural inspection only.
Gerber Specification Reference
This project targets a practical modern subset of the Gerber Layer Format (Ucamco), especially common X2 attributes and graphics-state commands used in manufacturing handoff files.
Source, fixture, generated-file, dependency, and AI-assistance disclosures are documented in docs/PROVENANCE.md.
License
Apache-2.0. See LICENSE.