Repository navigation
fix(core): track deprecated_at for correct time-travel recall (#1086) - #1100
Merged
Merged
Conversation
- Schema v17: add deprecated_at column, backfill legacy deprecated rows - Set deprecated_at on all deprecate paths, clear on restore - recall_at_time: memory deprecated AFTER the point-in-time now appears (previously any deprecated flag excluded it); deprecated BEFORE is excluded - memory_exists_at handler: same temporal predicate - recall_inner(include_deprecated) so temporal path sees deprecated rows - Regression test (no ONNX dependency)
…op stray embed_cache.db
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
What (description of the change)
Fixes #1086 — time-travel recall (
recall_at_time/memory_exists_at) incorrectly excluded any deprecated memory regardless of when it was deprecated. A memory deprecated after the point-in-time did exist at that moment and must still appear in historical recall.deprecated_at TEXTcolumn (schema.rs,store.rs):ALTER TABLE+ backfill of legacy deprecated rows (deprecated_at = updated_at).deprecated_at = now(bulk.rs,edges.rs); restore clears it.Memorytype — newdeprecated_at: Option<DateTime<Utc>>field, persisted in INSERT/SELECT row mapping.recall_at_time+ servermemory_exists_at): deprecated before pit → excluded; deprecated after pit → included;NULLtreated as "after" (unreachable post-migration), identical in core and server.recall_inner(include_deprecated)— internal variant so the temporal path fetches deprecated candidates and applies the time predicate itself; normalrecallkeeps filtering deprecated rows (unchanged).Why (the problem you're solving)
The deprecation flag (
deprecated = 1) is a boolean with no timestamp, so temporal predicates could not distinguish "deprecated before the pit" from "deprecated after the pit". Both were excluded — making time-travel recall return wrong history for any memory that was deprecated after the queried moment.Testing (how you verified this works)
test_recall_at_time_deprecated_after_pit(core, no ONNX needed) — passes.at_time_includes_deprecated_after_pit; legacyat_time_excludes_deprecatedupdated to the new semantics — all pass.cargo test --workspace— all pass (516 core + server + mcp).cargo clippy --workspace --all-targets— clean;cargo fmt --all— clean.Closes #1086