#589 The desktop store validates measures and their values (#588)
–
- github
- github/openchronology/timeline-app
- github/openchronology/timeline-app#589
- pull request
- state:merged
Closes #588, a follow-up to #570. The desktop store (`native-store`, behind the desktop app and `och-convert`) kept measure declarations and values as the editor sent them. It now checks them as the editor and server do, on whole saves, sparse saves and in `och-convert`: - **Declarations:** - at most 32; - names as `src/measures.ts` allows; - type `mpz` or `mpq`; - labels of 1 to 80 characters; - a bounded presentation. - **Values:** - only declared names; - canonical exact text: integers without leading zeros, fractions never `n/1`; - whole numbers for `mpz`, and never zero; - at most 2,200 characters, on moments and durations alike. - Fractions must be in lowest terms. Rust has no exact rationals here, so the rational extension checks that where values are written. **Tests:** a new Rust test covers each refusal. The totals tests' generators no longer write zeros, which the editor never stores. `cargo test --lib`: 39 pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_011fFY8eruEi1xAkkMBni13B https://github.com/circagraph/timeline-app/pull/589
Related
Open #589 The desktop store validates measures and their values (#588) in the timeline