You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(manifest): add explicit enable_constraints; cap enabled_count at 8 (#70)
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>
0 commit comments