moonprobe

    Bounded JSON tool-contract testing, unique case generation, shrinking and regression replay.

    testing
    json
    property-testing
    shrinking
    Download zip
    Version
    0.3.1
    License
    Apache-2.0
    Last updated
    yesterday
    Downloads
    13

    No dependencies

    #MoonProbe

    MoonProbe 是用 MoonBit 实现的离线工具契约测试引擎:按声明的 JSON Schema 子集生成输入、验证输出、缩减失败反例,并回放历史语料。核心库支持 Wasm-GC;Windows CLI 的安装、构建和完整验证步骤见 Windows 使用指南。

    Pure MoonBit core for bounded JSON tool-contract testing. The registry module provides the reusable 3518936226-afk/moonprobe/engine package, its tests and a portable example. The Windows CLI, process bridge and release executables stay in the GitHub repository.

    #Install and use

    moon add 3518936226-afk/moonprobe

    Import the engine in your package:

    import {
    "3518936226-afk/moonprobe/engine" @probe,
    }

    The included example defines an echo contract, generates 16 unique bounded test cases, checks outputs and prints a summary. From an unpacked source archive:

    moon run examples/library --target wasm-gc moon test engine --target wasm-gc

    Expected example output: {"failed":0,"passed":16}.

    For a new consumer project, copy the example main.mbt into your executable package and add the import above to its moon.pkg, along with pkgtype(kind: "executable"). Then run that package with moon run.

    For your own tool, construct Adapter { family, version, invoke } and call test_adapter_report. invoke accepts JSON and returns Result[Json, String]. Expected-invalid generated cases are validated locally without invoking the adapter. shrink_adapter searches for simpler same-signature failures; replay_adapter_report rechecks saved corpus entries.

    #Limits and attribution

    This is a bounded JSON Schema subset, not full standard conformance. Supported rules and budgets are in docs/support-matrix.md. Coverage witnesses do not prove business semantics, and shrinking does not promise a global minimum. parse_bounded_json rejects more than 32 nested containers, duplicate keys and malformed JSON. The library uses no network, credentials or Python runtime.

    The package targets MoonBit 1.0.0-rc1 or newer. Source is Apache-2.0; third-party validation references are recorded in THIRD_PARTY_NOTICES.md. Python reference validation and upstream fixture data are development-only and are not bundled as production runtime dependencies.

    Publication is a later release with its actual timestamp. It does not alter or claim inclusion in the competition's November 30 repository snapshot.