Operational guidance for human and AI agents working in jtd-wasm. This document supplements the user-facing README.md and JTD_CODEGEN_SPEC.md with developer-centric workflows and policies.
- Zero Tolerance for Warnings:
xmake run check(fmt + clippy) must pass before any commit. - Mandatory Verification: Run
xmake run test_allbefore verifying a task complete. - Cross-Platform Compatibility: Ensure
xmake run test_allpasses on macOS and Linux. - Windows Policy: See "Windows Testing Strategy" below.
We validate against the official json-typedef-spec test suite.
- Source:
.tmp/json-typedef-spec(fetched viaxmake run fetch_suite) - Verification: SHA256 checksums enforce suite integrity.
- Rust (Native): Tested on all platforms (macOS, Linux, Windows).
- WebAssembly (WASI): Tested on all platforms via
wasmtime. - JavaScript (ESM): Tested on macOS/Linux via
quickjs-rs. - Lua (5.1/LuaJIT): Tested on all platforms via
mlua+dkjson. - Python (3.11+): Tested on macOS/Linux via
python3subprocess.
We strictly enforce Rust → Rust and Rust → WASM correctness on Windows. However, we skip JavaScript validation tests on Windows (test_js target).
Reasoning:
- Not a workaround: This is an intentional policy, not a temporary hack.
- Core Value: Our primary deliverable for Windows users is the Rust-based code generator. The generated JavaScript logic is identical across all platforms (it is deterministic string emission).
- Tooling Limitations: The
quickjs-rscrate (our test harness for JS) does not currently compile on MSVC Windows. We decline to maintain a complex C/C++ build toolchain just to run the JS test harness on Windows when the generator logic is already verified on Linux/macOS. - Confidence: Since
jtd-codegenproduces identical output regardless of the host OS, verifying the JS output on Linux/macOS provides sufficient confidence for Windows users deploying that same JS code. - Full-Stack Rust: Windows users targeting the browser should prefer our WASM path (
Rust -> Rust -> WASM), which is fully tested and supported on Windows.
# Full suite (fmt, clippy, fetch spec, run all tests)
xmake run test_all
# Specific targets
xmake run test_rust
xmake run test_js # Skips on Windows
xmake run test_lua
xmake run test_py
xmake run test_wasmInstall the pre-commit hook to prevent accidental regressions:
xmake run install_hooks- Bump version in
jtd-codegen/Cargo.toml. - Commit and tag:
git tag release/x.y.z. - Push tag:
git push origin release/x.y.z. - GitHub Actions will build and attach binaries for macOS, Linux, and Windows.