Summary
The moral algebra system (symthaea-core/src/hdc/moral_algebra.rs) currently has unit tests but could benefit from proptest-based property testing to verify mathematical invariants.
Properties to verify
- Commutativity of moral composition — does order of stakeholder consideration matter?
- Associativity — grouping of moral factors should not change outcome
- Monotonicity of moral distance — adding harm should never decrease moral distance
- Boundary behavior — extreme values (0.0, 1.0) should produce well-defined results
- Idempotency — applying the same moral consideration twice should be stable
- Triangle inequality — moral distance should satisfy metric properties
Existing patterns
See tests/proptest_feedback_stability.rs and tests/proptest_cantor.rs for proptest patterns already used in the codebase.
Getting started
- Add
proptest = "1" to dev-dependencies (already in workspace)
- Create
tests/proptest_moral_algebra.rs
- Use
proptest! macro with custom strategies for moral values
- Current moral algebra score: 91.1% overall — tests should protect this
Moral algebra primer
The system encodes ethical principles as hypervectors and computes moral distances, compositions, and judgments using HDC operations. The key types are in moral_algebra.rs, moral_prototypes.rs, and moral_parser.rs.
Summary
The moral algebra system (
symthaea-core/src/hdc/moral_algebra.rs) currently has unit tests but could benefit from proptest-based property testing to verify mathematical invariants.Properties to verify
Existing patterns
See
tests/proptest_feedback_stability.rsandtests/proptest_cantor.rsfor proptest patterns already used in the codebase.Getting started
proptest = "1"to dev-dependencies (already in workspace)tests/proptest_moral_algebra.rsproptest!macro with custom strategies for moral valuesMoral algebra primer
The system encodes ethical principles as hypervectors and computes moral distances, compositions, and judgments using HDC operations. The key types are in
moral_algebra.rs,moral_prototypes.rs, andmoral_parser.rs.