Repository navigation
feat: revalidate decisions that cite files; flag them, don't hide them (#123) - #127
Merged
Merged
Conversation
…sion-revalidation) From the review of #126, not merged with it: FR-003 covers recall's order="newest" path through a checkpoints_newest_first() keyword (include_flagged_decisions, default off) that only recall sets, so the lifecycle's checkpoint selection is unchanged; FR-004 has both result builders fill the new fields; SC-3c checks both sides; plan and tasks cite the replay as SC-3b. Refs #123.
#123) A new decision records source_hash for a readable source under the project root (a dedup hit keeps the existing record's source and hash). revalidate() flags decisions changed or missing (hashless ones only missing) and adds a type key to flagged items. recall returns flagged decisions on the relevance and newest paths, with additive needs_review and review_reason on every result; flagged code stays hidden; the lifecycle's checkpoint choice is unchanged. The session-start list names each item's type with a type-aware hint. README, tool docstring, CHANGELOG. Refs #123.
…mendment A1) The session-start, compaction-recovery and on_post_compact context lines label a flagged memory with its reason, e.g. [decision, needs review: changed], so a flagged decision shown there is marked as recall marks it. Tests for the startup and compaction blocks; spec amendment A1. Review of PR #127.
A hashless decision's present file clears only a missing flag; any other flag is kept and counted unknown. The session-start review list shows every memory still flagged, not only those found in this pass. SC-4 is tested on a record with no source_hash key (raw metadata checked). README, consolidate and POST /revalidate no longer say code only. Spec FR-002 and FR-005. Refs #123.
This was referenced Nov 15, 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.
Refs #123. The build of the approved spec (#126,
specs/memkernel-0-10-decision-revalidation/).Commits
db4a251spec review amendment (from the review of spec: revalidate decisions that cite files (#123) #126, which merged before it): FR-003 coversrecall(order="newest")through acheckpoints_newest_first(include_flagged_decisions=False)keyword that only recall sets, so the lifecycle's checkpoint selection is unchanged; FR-004 has both result builders fill the new fields; SC-3c checks both sides; plan and tasks cite the replay as SC-3b.0e68953the build.2c29939amendment A1 (review of feat: revalidate decisions that cite files; flag them, don't hide them (#123) #127): the hook blocks' context lines (session start, compaction recovery,on_post_compact) label a flagged memory with its reason, e.g.[decision, needs review: changed].f2fd55bsecond review of feat: revalidate decisions that cite files; flag them, don't hide them (#123) #127: a hashless decision's present file clears only amissingflag (any other flag is kept, countedunknown); the session-start list shows every memory still flagged, including one whose file could not be read this pass; SC-4 tested on a record with nosource_hashkey (raw metadata checked); README,consolidateandPOST /revalidateno longer say code only.Changes
core/services.py,_new_metadata): a new decision recordssource_hashwhen itssourceis a readable file under the project root. A dedup hit returns the existing record unchanged (it never reaches_new_metadata).Memory.source_hashloads empty from older records.sourceare flaggedchanged(hash differs) ormissing; hashless decisions onlymissing, and a present file clears only that flag; a restored file clears the flag; outside the project root or unreadable isunknown.flaggeditems gain atypekey (additive).order="newest"; everyArtifactRefcarriesneeds_reviewandreview_reason, filled by both builders. Flaggedcodestays hidden;checkpoints_newest_first()'s default is unchanged.### Needs reviewlines name each item's type ([decision],[code]), with a hint for both; context lines mark a flagged memory ([decision, needs review: changed]).recallrow), therecalltool's docstring, CHANGELOG under[Unreleased].Tests
tests/unit/test_decision_revalidation.py(17): SC-1 the Preserve and retrieve implementation alternatives for reuse-first coding #57 file probe (flagged and still returned; code hidden); SC-2 clearing, a record with nosource_hashkey (SC-4; flagged only when missing, never hashed later), an empty hash, a keptchangedflag on a hashless decision, source outside the root or missing at retain, no source; SC-3 cross-source dedup, same-source dedup, a hashless dedup hit; SC-3c the newest path and the lifecycle's selection; D1 the startup list; A1 the startup and compaction blocks' marked context lines (they fail on0e68953), and an unflagged decision's plain label; a durable flag still listed when its file is unreadable.tests/unit/test_revalidation.py: three exact comparisons now expect thetypekey and the[code]prefix.Checks
results-k5.json; its file probe now flags the decision on rewrite and delete._exempt_from_review_hiding), three answered (the hash is the retain-time baseline by spec; the newest path ignoringinclude_needs_reviewis the spec's choice; a directorysourcecounts as missing, as for code).