Skip to content

feat(manifest): explicit enable_constraints field; cap enabled_count at 8#70

Merged
hyperpolymath merged 1 commit into
mainfrom
fix/explicit-enable-constraints
May 14, 2026
Merged

feat(manifest): explicit enable_constraints field; cap enabled_count at 8#70
hyperpolymath merged 1 commit into
mainfrom
fix/explicit-enable-constraints

Conversation

@hyperpolymath
Copy link
Copy Markdown
Owner

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.

  • Add enable_constraints: bool to OctadConfig (default true)
  • Rewrite enabled_count() to be a pure sum over the six togglable flags; result guaranteed in 2..=8 by construction
  • print_status reads enable_constraints directly; toggling a different dimension no longer flips the Constraints line
  • init_manifest template emits enable-constraints = true

Closes

Test plan

  • cargo clippy --all-targets -- -D warnings clean
  • 29 unit tests pass (3 new in manifest::octad_tests)
  • Exhaustive 64-case test asserts enabled_count() ∈ 2..=8
  • All 7 existing OctadConfig { ... } literals updated with the new field

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>
@hyperpolymath hyperpolymath merged commit 4315990 into main May 14, 2026
15 of 17 checks passed
@hyperpolymath hyperpolymath deleted the fix/explicit-enable-constraints branch May 14, 2026 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

V-L2-D1: explicit enable_constraints + cap enabled_count at 8

1 participant