Skip to content

Comments

fix: 8 pipeline bugs from deep audit (graph dedup, feedback wiring, decay)#66

Merged
varun29ankuS merged 2 commits intomainfrom
fix/pipeline-audit-round4
Feb 23, 2026
Merged

fix: 8 pipeline bugs from deep audit (graph dedup, feedback wiring, decay)#66
varun29ankuS merged 2 commits intomainfrom
fix/pipeline-audit-round4

Conversation

@varun29ankuS
Copy link
Owner

Summary

  • Graph dedup: Removed duplicate graph processing from remember() — only process_experience_into_graph() at the handler layer creates entities/edges now, preventing inflated mention_counts and spurious edge strengthening
  • Feedback → graph wiring: When feedback confirms a memory was helpful, its episode's entity edges are now strengthened via strengthen_episode_entity_edges() (Hebbian: what fires together wires together)
  • Context pattern detection: Wired detect_context_pattern(), apply_context_pattern_signals(), and set_previous_context() into the proactive_context handler — repetition and topic-change signals now modulate feedback
  • Full graph decay: apply_decay() now runs on heavy maintenance cycles (every 6 hours) alongside lazy pruning, ensuring no edge escapes time-based weakening
  • Upsert episode cleanup: delete_episode() is called before process_experience_into_graph() on updates, preventing stale edges from prior versions
  • Batch dedup: Content-hash dedup rejects duplicate items within the same batch
  • Relevance EMA decay: Fixed relevance.rs using raw .ema instead of .ema_with_decay() — stale scores were shifting results by ~0.10
  • Dead code removal: Removed stability_with_decay() and its unused DECAY_STABILITY_HALF_LIFE_DAYS constant
  • Crash fix: Strip system noise (<task-notification>, <system-reminder> XML) at proactive_context handler entry in both Rust and MCP TypeScript, preventing BM25/embedding overload from multi-KB XML scaffolding

Test plan

  • cargo check + cargo clippy — zero errors, zero new warnings
  • Single remember → recall verified
  • Batch remember with duplicates: 3 in → 2 created, 1 rejected
  • Upsert create (v1) + update (v2) with was_update: true
  • Proactive context with previous_response → feedback loop fires
  • Repeated context triggers context pattern detection + repetition penalty
  • Relevance endpoint responds without errors

…ecay)

- Remove duplicate graph processing from remember() — handler's
  process_experience_into_graph() is the single graph path now
- Fix relevance.rs using raw .ema instead of .ema_with_decay()
- Add content-hash dedup to batch_remember (rejects intra-batch dupes)
- Wire feedback → graph edge strengthening via strengthen_episode_entity_edges()
- Add full apply_decay() on heavy maintenance cycles (every 6 hours)
- Clean up stale episode edges on upsert updates via delete_episode()
- Wire context pattern detection (repetition/topic change) into proactive_context
- Remove dead stability_with_decay() and its unused constant
- Strip system noise from proactive_context at handler entry (crash fix)
- Add client-side stripSystemNoise() in MCP server TypeScript
@varun29ankuS varun29ankuS merged commit 20ac752 into main Feb 23, 2026
9 checks passed
@varun29ankuS varun29ankuS deleted the fix/pipeline-audit-round4 branch February 23, 2026 13:28
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.

1 participant