MoonFeatureGate is a MoonBit-native feature flag and gradual rollout toolkit.
It evaluates flags locally, explains why a value was chosen, and keeps the
core runtime independent from a hosted control plane.
This repository is prepared for the 2026 MoonBit open-source ecosystem
competition. The project focuses on reusable engineering infrastructure:
targeting rules, stable percentage rollout, typed flag values, CLI validation,
examples, tests, and a clear path toward OpenFeature-style providers.
Project Summary
MoonFeatureGate provides a compact local runtime for feature management in
MoonBit projects. It is useful for libraries, demos, WASM applications, and
small services that need auditable rollout decisions without depending on a
remote feature-flag platform.
Core capabilities in 0.1.0:
typed flag values for bool, string, int, and double values
local bool evaluation with default, disabled, static, rollout, and target
match explanations
deterministic 0..9999 rollout buckets over flag_key:targeting_key
a compact text configuration DSL
a runnable CLI demo
black-box and white-box MoonBit tests
CI verification for formatting, checks, tests, and demo execution
Quick Start
Run the verification set from the repository root:
moon info
moon fmt --check
moon check --warn-list +73
moon test
moon run cmd/moonfeaturegate
This is an original MoonBit project, not a direct port of a single upstream
library.
The design is informed by mature feature-flag systems and the
vendor-neutral OpenFeature idea, while the first release intentionally keeps
a compact local API.
The repository is public, licensed under Apache-2.0, and prepared for
Mooncakes publication.
Planned extensions include JSON/TOML providers, an OpenFeature-like provider
boundary, metrics hooks, remote config polling, and a small web preview.
MoonFeatureGate
MoonFeatureGate is a MoonBit-native feature flag and gradual rollout toolkit. It evaluates flags locally, explains why a value was chosen, and keeps the core runtime independent from a hosted control plane.
This repository is prepared for the 2026 MoonBit open-source ecosystem competition. The project focuses on reusable engineering infrastructure: targeting rules, stable percentage rollout, typed flag values, CLI validation, examples, tests, and a clear path toward OpenFeature-style providers.
Project Summary
MoonFeatureGate provides a compact local runtime for feature management in MoonBit projects. It is useful for libraries, demos, WASM applications, and small services that need auditable rollout decisions without depending on a remote feature-flag platform.
Core capabilities in
0.1.0:flag_key:targeting_keyQuick Start
Run the verification set from the repository root:
Expected demo output:
Core API
Configuration DSL
Each non-empty line defines one flag. Lines starting with
#are comments.Supported
0.1.0forms:flag <key> bool <true|false>flag <key> bool <true|false> rollout <0..10000>flag <key> bool <true|false> target <attribute> <string-value>Repository Layout
MoonFeatureGate.mbt,provider.mbt,rollout.mbt,parser.mbt: core library implementation*_test.mbt: library test coveragecmd/moonfeaturegate: runnable CLI demoexamples/flags.mfg: sample configuration filedocs/design.md: design notes and extension directiondocs/acceptance-checklist.md: competition closeout checklistdocs/closeout.md: final submission notesCompetition Notes
Links
中文简介
MoonFeatureGate 是一个 MoonBit 原生的特性开关与灰度发布工具库。它支持本地规则评估、用户定向、 稳定百分比分桶、命中原因解释和 CLI 校验,适合用于 MoonBit 项目的功能灰度、实验开关和配置策略管理。
项目面向 MoonBit 开源生态建设,重点补齐工程基础设施方向中的“可测试、可审查、可复用”的本地特性管理能力。