ai_memory/notification/mod.rs
1// Copyright 2026 AlphaOne LLC
2// SPDX-License-Identifier: Apache-2.0
3
4//! v0.7.0 L2-3 (issue #668) — Reflection invalidation propagation.
5//!
6//! When a Reflection→Reflection `supersedes` edge lands, the substrate
7//! walks every memory that `reflects_on` the now-invalidated reflection
8//! and writes a notification memory into `<namespace>/_invalidations`.
9//! Operators (or the curator) inspect those notifications and decide
10//! whether to re-reflect, supersede, or leave the dependent untouched
11//! — the propagation is **notification, not cascade**.
12//!
13//! The split into a free-standing top-level module (rather than
14//! folding the helper into `storage::` or `mcp::tools::`) keeps the
15//! invalidation walker decoupled from both the storage shape and the
16//! MCP wire surface. The walker takes a `&Connection` and a small
17//! `InvalidationContext` struct; callers compose it however they like
18//! (today: the `memory_link` handler in `mcp::tools::link`, the new
19//! `memory_dependents_of_invalidated` MCP tool in `mcp::tools`).
20
21pub mod invalidation;