feat(manifest): explicit enable_constraints field; cap enabled_count at 8#70
Merged
Merged
Conversation
Closes #34. OctadConfig previously had no `enable_constraints` field. The Constraints dimension was "implied" via `if enabled_count > 2 { count += 1; }`, which meant: 1. Toggling any other dimension silently flipped Constraints ON or OFF in `print_status`. 2. The cap of 8 dimensions was implicit; nothing prevented overflow. 3. ADR-0001's first-class treatment of Constraints had no representation in the data model. Changes: - Add `enable_constraints: bool` to `OctadConfig` (defaults to true, serde rename `enable-constraints`). - Rewrite `enabled_count()` to count each `enable_*` field once. The implicit `+1` arithmetic is gone; the result is now guaranteed to be in `2..=8` by construction. - `print_status` reads `enable_constraints` directly instead of inferring it from the total count. - `init_manifest` template emits `enable-constraints = true`. - Update six existing test fixtures and one integration test that construct OctadConfig literals to include the new field. Add three new unit tests in `manifest::octad_tests`: - `enabled_count_is_in_range_2_to_8`: exhaustively checks all 64 combinations of the six togglable flags and asserts the result is always in 2..=8. - `enabled_count_with_all_off_is_two`: data + metadata baseline. - `enabled_count_with_all_on_is_eight`: full octad. `cargo clippy --all-targets -- -D warnings` clean; 29 unit tests pass. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Per V-L2-D1: Make Constraints a first-class octad dimension instead of an implicit "+1 when count>2" arithmetic side-effect, and prove the cap.
enable_constraints: booltoOctadConfig(defaulttrue)enabled_count()to be a pure sum over the six togglable flags; result guaranteed in2..=8by constructionprint_statusreadsenable_constraintsdirectly; toggling a different dimension no longer flips the Constraints lineinit_manifesttemplate emitsenable-constraints = trueCloses
Test plan
cargo clippy --all-targets -- -D warningscleanmanifest::octad_tests)enabled_count() ∈ 2..=8OctadConfig { ... }literals updated with the new field