Skip to content

feat(init): add hard_compaction_threshold prompt to --init wizard (#1719)#1763

Merged
bug-ops merged 3 commits intomainfrom
hard-compaction-threshold
Mar 14, 2026
Merged

feat(init): add hard_compaction_threshold prompt to --init wizard (#1719)#1763
bug-ops merged 3 commits intomainfrom
hard-compaction-threshold

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

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

Summary

  • Adds hard_compaction_threshold prompt to step_memory() in the --init wizard, after the existing soft threshold prompt
  • Stores value in WizardState (default 0.90) and writes it to config.memory.hard_compaction_threshold in build_config()
  • Cross-field validation: hard > soft, plus is_finite() guards on both prompts
  • Soft prompt hint updated to reference the 0.90 default for user guidance

Changes

  • src/init.rs: add hard_compaction_threshold field to WizardState with custom Default (0.70/0.90 sentinels), add hard threshold prompt loop in step_memory(), write value in build_config()
  • CHANGELOG.md: add entry to [Unreleased] ### Added
  • 4 new unit tests: default mapping, custom values, boundary (hard=1.0), dumb-mapper (hard < soft passes through)

Test plan

  • cargo +nightly fmt --check — pass
  • cargo clippy --workspace --features full -- -D warnings — pass
  • cargo nextest run --config-file .github/nextest.toml --workspace --features full --lib --bins — 5514 passed
  • Run cargo run -- --init and verify wizard prompts for both soft and hard thresholds in sequence
  • Verify invalid input (hard <= soft) shows an error and re-prompts
  • Verify generated config.toml contains correct hard_compaction_threshold value

Closes #1719

bug-ops added 2 commits March 14, 2026 18:06
)

Add hard_compaction_threshold prompt to step_memory() after the soft
threshold prompt, with cross-field validation (hard > soft) and
is_finite() guards. Store in WizardState (default 0.90) and write to
config.memory.hard_compaction_threshold in build_config().

Also adds custom Default impl for WizardState with valid sentinels
(0.70/0.90), explanatory comment on the hard threshold loop (dialoguer
API constraint), and 4 unit tests covering default, custom, boundary,
and inverted (dumb-mapper) scenarios.
@github-actions github-actions bot added enhancement New feature or request size/M Medium PR (51-200 lines) documentation Improvements or additions to documentation and removed enhancement New feature or request size/M Medium PR (51-200 lines) labels Mar 14, 2026
@bug-ops bug-ops enabled auto-merge (squash) March 14, 2026 17:09
@github-actions github-actions bot added enhancement New feature or request size/M Medium PR (51-200 lines) labels Mar 14, 2026
@bug-ops bug-ops merged commit 166e569 into main Mar 14, 2026
15 checks passed
@bug-ops bug-ops deleted the hard-compaction-threshold branch March 14, 2026 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request size/M Medium PR (51-200 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(init): add hard_compaction_threshold prompt to --init wizard

1 participant