Skip to content

feat(core): validate deferred_apply_threshold < compaction_threshold#1381

Merged
bug-ops merged 2 commits intomainfrom
validate-threshold-ordering
Mar 9, 2026
Merged

feat(core): validate deferred_apply_threshold < compaction_threshold#1381
bug-ops merged 2 commits intomainfrom
validate-threshold-ordering

Conversation

@bug-ops
Copy link
Owner

@bug-ops bug-ops commented Mar 9, 2026

Summary

  • Enforce deferred_apply_threshold < compaction_threshold ordering invariant in Config::validate(), covering all startup paths (runner, daemon, ACP, tui_remote)
  • Both thresholds validated as finite and in (0.0, 1.0) exclusive range, rejecting NaN/Infinity
  • --init wizard re-prompts on ordering violation instead of silently accepting
  • Removed dead post-hoc eprintln! warning in build_config()
  • Added config.validate() call in tui_remote after Config::load()
  • 11 new unit tests covering range, ordering, boundary values, NaN, and Infinity

Closes #1302

Test plan

  • cargo +nightly fmt --check passes
  • cargo clippy --workspace --features full -- -D warnings passes
  • cargo nextest run --workspace --features full --lib --bins passes (4776 tests, 0 failures)
  • Manual: run --init wizard, enter deferred threshold >= 0.80, verify re-prompt
  • Manual: set deferred_apply_threshold = 0.85 in config.toml, verify startup error

bug-ops added 2 commits March 9, 2026 02:32
…1302)

Enforce threshold ordering invariant at config load and in --init wizard.
Both thresholds must be finite and in (0.0, 1.0) exclusive range.
Wizard re-prompts on violation instead of silently accepting.
Add config.validate() call in tui_remote after Config::load().
@github-actions github-actions bot added documentation Improvements or additions to documentation rust Rust code changes core zeph-core crate enhancement New feature or request size/M Medium PR (51-200 lines) labels Mar 9, 2026
@bug-ops bug-ops enabled auto-merge (squash) March 9, 2026 01:35
@bug-ops bug-ops merged commit f70e02c into main Mar 9, 2026
25 checks passed
@bug-ops bug-ops deleted the validate-threshold-ordering branch March 9, 2026 01:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core zeph-core crate documentation Improvements or additions to documentation enhancement New feature or request rust Rust code changes size/M Medium PR (51-200 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(core): validate deferred_apply_threshold < compaction_threshold in wizard

1 participant