Repository navigation
feat(memory): temporal validity + review-gated supersession for lessons - #72
Merged
Merged
Conversation
…ns (Phase 2 steps 1-8,10)
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.
Phase 2 — temporal validity + review-gated contradiction supersession
Builds on #71 (uses its contradiction-labeled dataset for stale-metric validation). Steps 1–8 and 10 of the approved plan; step 9 (bench-harness stamping) lands after #71 merges.
What
Lessons now carry temporal validity and contradictions become review-gated supersessions — never auto-applied:
statusenum +superseded;valid_from/valid_until/superseded_by/supersedesas a brainstack extension block.recall/frontmatter.py:TemporalMeta+temporal_meta()— single normalization point (aliases, date coercion, garbage →None, never raises).write_lessonstampsvalid_from(+status: currentwhen reviewed); projection emitsstatus/valid_fromfromsource_ts_epoch.render_lessons.update_lesson: flock, last-match, in-place flip ofstatus/superseded_by/valid_until;extract_lesson_linesskips superseded.graduate.py: graduating a supersession candidate persists the pair (new row + updated old row),--supersedesdefault for supersession candidates.agent/memory/contradictions.py(new): pure, deterministic, no-LLM detector — slot-conflict → predicate-value → condition-overlap (Jaccard/token-J windows, exact-dup excluded).kind: supersessioncandidates;auto_dreamstages post-consolidation; rejected candidates restage only on new evidence; 1.5× candidate priority.apply_temporal_policymirrorsapply_review_policy—ranking.superseded_policy(demotedefault /exclude/ignore) +superseded_penalty0.5, threaded through CLI, MCP server, and daemon;valid_fromtie-break; Qdrant filter forexclude.Invariant preserved everywhere: supersession only ever stages a candidate for human review; nothing auto-rewrites a durable lesson.
Test plan
2429 passed, 2 skipped, 230 deselected