Skip to content

feat(config): configurable dream pipeline thresholds (#731)#742

Merged
ajianaz merged 3 commits into
developfrom
feat/configurable-dream-thresholds
Jul 18, 2026
Merged

feat(config): configurable dream pipeline thresholds (#731)#742
ajianaz merged 3 commits into
developfrom
feat/configurable-dream-thresholds

Conversation

@ajianaz

@ajianaz ajianaz commented Jul 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

Replaces all hardcoded dream pipeline constants with configurable values via [dream] config section. Also changes [maintenance] defaults to safer values.

Breaking Change (defaults only)

Setting Old Default New Default Why
auto_aging_enabled true false Auto-delete should be opt-in
auto_aging_interval_hours 6 24 4 cycles/day too aggressive
auto_dream_interval_days 3 7 Weekly is enough
orphan_importance_threshold 0.3 0.15 Old value flagged most auto-extracted memories
contradict_tag_jaccard_min 0.3 0.4 30% overlap too common

New Config Section

[dream]
contradict_similarity_threshold = 0.6   # Cosine > this → NOT contradiction
contradict_tag_jaccard_min = 0.4       # Tag overlap ≥ this → consider contradict
contradict_max_memories = 200          # O(n²) scan limit
dedup_threshold = 0.92                # Cosine > this → merge candidate
orphan_importance_threshold = 0.15    # Importance < this → orphan candidate

Files Changed

  • config.rs — DreamConfig struct + MaintenanceConfig safer defaults
  • lib.rs — DreamConfig on Uteke struct + set_dream_config() setter
  • dream.rs — Read from self.dream_config instead of const values
  • orphans.rs — DEFAULT_ORPHAN_THRESHOLD 0.3 → 0.15
  • uteke-cli/main.rs — Wire dream config at startup
  • uteke-server/main.rs — Read [dream] from uteke.toml, wire at startup

Closes #731

Replaces hardcoded dream pipeline constants with configurable values.

Changes:
- DreamConfig struct (uteke-core + uteke-cli config)
  - contradict_similarity_threshold: 0.6 (cosine > this → NOT contradiction)
  - contradict_tag_jaccard_min: 0.4 (up from 0.3, reduces false positives)
  - contradict_max_memories: 200 (O(n²) scan limit)
  - dedup_threshold: 0.92 (cosine > this → merge candidate)
  - orphan_importance_threshold: 0.15 (safer than old 0.3)
- MaintenanceConfig defaults changed to safer values:
  - auto_aging_enabled: true → false (opt-in)
  - auto_aging_interval_hours: 6 → 24 (daily)
  - auto_dream_interval_days: 3 → 7 (weekly)
- DreamConfig wired into CLI main.rs and server main.rs via set_dream_config()
- dream.rs reads from self.dream_config instead of const values
- DEFAULT_ORPHAN_THRESHOLD updated 0.3 → 0.15
- Server reads [dream] section from uteke.toml

Config example:
  [dream]
  contradict_similarity_threshold = 0.6
  contradict_tag_jaccard_min = 0.4
  contradict_max_memories = 200
  dedup_threshold = 0.92
  orphan_importance_threshold = 0.15

Closes #731
@ajianaz ajianaz self-assigned this Jul 18, 2026
/// Set dream pipeline thresholds (#731).
///
/// Overrides the default hardcoded values for contradiction scan,
/// dedup/consolidate, and orphan detection phases. Called once at
info!("Opening store at: {db_path}");
let uteke = match Uteke::open(&db_path) {
Ok(u) => Arc::new(Mutex::new(u)),
Ok(mut u) => {
@github-actions

github-actions Bot commented Jul 18, 2026

Copy link
Copy Markdown

🔍 Cora AI Code Review

⚠️ Review could not complete. Cora produced an empty result. Check the workflow logs for errors.


Review powered by cora-cli · BYOK · MIT

ajianaz added 2 commits July 18, 2026 20:27
- consolidate() expects f32 not f64 — remove incorrect cast
- Server dream config: unwrap_or_default() for Option<usize> returns 0
  (wrong), use unwrap_or(DreamConfig::default().*) instead
- Format: restructure server dream config block for rustfmt compliance
@ajianaz
ajianaz merged commit 8575822 into develop Jul 18, 2026
7 of 8 checks passed
@ajianaz
ajianaz deleted the feat/configurable-dream-thresholds branch July 18, 2026 13:38
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.

configurable dream/dedup thresholds + safer defaults

2 participants