feat(memory): SleepGate forgetting pass + performance-floor compression predictor#2614
Merged
feat(memory): SleepGate forgetting pass + performance-floor compression predictor#2614
Conversation
…on predictor Implements two memory quality improvements: 1. SleepGate forgetting sweep (#2397) - Three-phase consolidation step: synaptic downscaling, selective replay, targeted pruning — all within a single SQLite transaction - Phase 2 replay scoped to Phase 1 batch IDs to prevent score inflation - Config: [memory.forgetting] with enabled, decay_rate, forgetting_floor, sweep_interval_secs, sweep_batch_size, replay_window_hours, protect_min_access_count fields - Validation at sweep entry: decay_rate in (0.0, 1.0), forgetting_floor in [0.0, 1.0), sweep_interval_secs >= 60 - Background loop in runner.rs alongside eviction/consolidation 2. Compression ratio predictor (#2460) - Linear regression predictor trained on (ratio, probe_score) pairs - select_ratio() finds most aggressive ratio clearing the performance floor - Cold-start fallback when < 10 samples; sliding window of 200 samples - Data pipeline complete; integration into summarization path deferred - Config: [memory.compression.predictor] Migrations: 064 (forgetting index), 065 (predictor tables) — both SQLite and Postgres dialects. Integration: CLI subcommands, TUI commands, --init wizard, --migrate-config steps 7-8, testing playbook, coverage-status rows. Closes #2397, closes #2460
PostgreSQL stores consolidated as BOOLEAN — the WHERE clause must use NOT consolidated, not consolidated = 0 (SQLite integer comparison).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
decay_rate ∈ (0.0, 1.0)andsweep_interval_secs ≥ 60to guard against destructive misconfiguration.(compression_ratio, probe_score)pairs, selects the most aggressive ratio that clears thehard_fail_thresholdperformance floor. Cold-start fallback (< 10 samples) returnsNone; caller falls back to default behavior. Data pipeline complete; integration into summarization path is a follow-up.Integration points
[memory.forgetting]and[memory.compression.predictor]zeph memory forgetting-sweep,zeph memory predictor-status/forgetting-sweep,/predictor-statusin command palette--initwizard: prompts for both features (default: disabled)--migrate-config: steps 8 and 9 in migration chain.local/testing/playbooks/sleepgate-compression.mdMigrations
064_forgetting_sweep_index— partial index on(importance_score, last_accessed, deleted_at)for sweep efficiency065_compression_predictor— training data and weight persistence tablesTest plan
cargo nextest run— 7660 passed, 15 skippedcargo clippy -- -D warnings— zero warningscargo +nightly fmt --check— cleanforgetting_enabled = trueand a long conversation to verify sweep fires and prunes stale low-importance messagesCloses #2397
Closes #2460