feat(learning): reduce maintenance signal noise#239
Conversation
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughImplements noise control and aging for learned signals by: (1) suppressing repeated candidate observations within a 24-hour window in the learning bridge, (2) introducing source-keyed upsert operations in AutoMemoryStore to replace stale entries, (3) updating pattern and trend miners to use upsert-by-source persistence, and (4) implementing source/category-specific aging thresholds to prune low-value maintenance signals more aggressively. Changes
Sequence DiagramsequenceDiagram
actor Learner as Learning Pipeline
participant Bridge as LearningMaintenanceCandidateBridge
participant Store as AutoMemoryStore
participant Consolidator as MemoryConsolidator
Learner->>Bridge: observe(miningResult)
alt Suppression Check
Bridge->>Bridge: recentSourceRefs() from candidates
Bridge->>Bridge: shouldSuppress(observation, recentSources)?
alt Source Recently Seen (< 24h)
Bridge-->>Learner: skip upsert
else New Source
Bridge->>Store: upsertBySource(category, content, source)
Store->>Store: replace existing or insert new
Store-->>Bridge: MemoryEntry
Bridge-->>Learner: upsert complete
end
end
note over Store: Later: Consolidation Pass
Consolidator->>Store: consolidate(archiveDir)
Consolidator->>Consolidator: for each entry: shouldArchive(entry, now)?
alt Archive Decision
Consolidator->>Consolidator: isMaintenanceDerived(entry)?
alt Maintenance Signal (source: maintenance:, trend:, etc.)
alt Age > 30 days
Consolidator->>Consolidator: archive (aggressive)
else Age < 30 days
Consolidator->>Store: keep entry
end
else Session Analysis (source: session-analysis:)
alt Age > 45 days
Consolidator->>Consolidator: archive
else Age < 45 days
Consolidator->>Store: keep entry
end
else Other Entry
alt Age > 90 days
Consolidator->>Consolidator: archive
else Age < 90 days
Consolidator->>Store: keep entry
end
end
end
Consolidator-->>Consolidator: purge archived entries
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Caution Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional.
❌ Failed checks (1 error, 1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Testing
Closes #230
Summary by CodeRabbit
Release Notes
New Features
Tests