- Rust edition:
2024(set inCargo.toml). - Minimum supported Rust version (MSRV): stable Rust with edition 2024 support.
- No nightly features required.
Every change must keep all of the following green. This is the contract for "passing CI" until a real CI pipeline exists.
cargo build # Compiles without errors
cargo test # 56 tests pass (40 unit + 12 integration + 4 doc-tests)
cargo clippy --all-targets -- -D warnings # Zero warnings (including examples/)
cargo doc --no-deps # Zero warningsCLI smoke tests against the committed example files:
cargo run -- convert -i examples/example.xml -o /tmp/test.json
cargo run -- convert -i /tmp/test.json -o /tmp/test.xml
cargo run -- info -i examples/example.xml
cargo run -- validate -i examples/example.xml --verify-crcThe validate --verify-crc invocation must report 0 errors across all 24
leads (2 waveforms × 12 leads in the example).
| Layer | Count | Where |
|---|---|---|
| Unit tests (error) | 7 | src/error.rs |
| Unit tests (patient) | 4 | src/patient.rs |
| Unit tests (test_demographics) | 3 | src/test_demographics.rs |
| Unit tests (diagnosis) | 3 | src/diagnosis.rs |
| Unit tests (waveform) | 7 | src/waveform.rs |
| Unit tests (measurements) | 3 | src/measurements.rs |
| Unit tests (order) | 3 | src/order.rs |
| Unit tests (io_xml) | 6 | src/io_xml.rs |
| Unit tests (io_json) | 4 | src/io_json.rs |
| Integration tests | 12 | tests/integration_test.rs |
| Doc-tests | 4 | src/lib.rs, src/io_xml.rs, src/io_json.rs, src/resting_ecg.rs |
| Total | 56 |
If you add or remove tests, update this table and the corresponding count in
/AGENTS.md and /spec.md.
examples/ contains both data and an example binary:
example.xml— canonical 12-lead, 2-waveform MUSE XML sample. Used by integration tests.example.json— same data in JSON. Must remain bit-equivalent (as parsedserde_json::Value) to the JSON produced fromexample.xml.example_new.xml— alternate sample used bytest_roundtrip.rs.restecg.dtd— reference DTD shipped with MUSE XML files.test_roundtrip.rs— standalone example binary (cargo run --example test_roundtrip).
To regenerate example.xml and example.json after a schema change:
cargo run --bin generate_examplesThe generator lives at src/bin/generate_examples.rs and must produce files
that satisfy every integration test in tests/integration_test.rs.
Before reporting a task complete, the agent must have personally run, and seen pass, at minimum:
cargo buildcargo testcargo clippy --all-targets -- -D warnings
If any check is skipped, say so explicitly in the final summary. Do not claim success on the basis of "the code looks right".