Repository navigation
feat(core,cli): opt-in history mode for time travel, recall/list --at --history (#1598) - #1652
Merged
Merged
Conversation
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
This was referenced Nov 3, 2026
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.
What
The second part of #1598 that is safe now (design: #1648,
docs/plans/2026-11-03-time-travel-1598.md§4, §5.2).uteke recall --at T --historyanduteke list --at T --historyalso return the memories deprecated afterT(forgotten, superseded, replaced by a contradiction).--historyrequires--at.Uteke::recall_at_time_history: today'srecall_at_timeresults plusStore::deprecated_after(the rows written at or beforeTand deprecated after it, with an embedding). Those rows pass through the samememory_existed_atpredicate and the same tag, namespace, entity and category filters. Each is scored by cosine similarity against the embedding kept in the row, with the same hot boost. The results are merged by score and truncated tolimit. The query is embedded a second time only when such rows exist.Uteke::list_at_time_with(.., history)/Store::list_at_time_with: the four SQL branches replacedeprecated = 0with(deprecated = 0 OR (?history AND (deprecated_at IS NULL OR deprecated_at > pit))).list_at_timeis thehistory = falsewrapper, so its SQL behaviour is unchanged.recall_innermoved intohot_boosted, so both paths score the same way.Why
#1598 / Atlas finding 2. Since #1086 the documented meaning of
atincludes memories deprecated after it, but every real deprecation path removes the vector, so the index-based candidate set never held them. The #1086 test only checked the predicate on a hand-builtMemory. The new tests go throughsoft_forgetandsupersede.The new mode is opt-in and only on the CLI, so CORE results do not change: the default
aton HTTP, MCP and the CLI is the same as before. Making history the default changes results for existing callers, so it waits on the contract issue uteke-cloud#458 (Gitea). uteke-cloud does not implementatat all, so it had nothing to match. With a running server--historyuses the local store, as other flags the HTTP body cannot carry do.Cost: one indexed query (
deprecated = 1plus time bounds) and one dot product for each memory deprecated afterT.prunebounds that set (deprecated_ttl_days).Testing
operations::time_travel::history_tests(keyword embedder, no ONNX): with one row forgotten and one superseded afterT, plainrecall_at_timereturns only the live row (the gap). History mode returns all three, sorted by score. After the deprecation it returns neither. The tests also cover the tag and namespace filters,limit, and an instant before the write. The list test runs all four SQL branches with history off and on.crates/uteke-cli/tests/time_travel_history.rs(real binary):list --atbetween the write and the forget is empty without--historyand holds the memory with it.--historywithout--atis refused.cargo test -p uteke-core -p uteke-cli -p uteke-server -p uteke-mcp,cargo clippy --workspace --all-targets -D warnings,cargo fmt, andcargo run -p docgen(no diff) all pass locally.