Repository navigation
fix: patterns can be deleted; a deleted observation leaves no trace in patterns - #75
Open
alexeybe1kin wants to merge 5 commits into
Open
alexeybe1kin wants to merge 5 commits into
alexeybe1kin wants to merge 5 commits into
Conversation
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.
Hunt finding memorygate-1 F28 (forgetting; Claude-written, one security review: no defect).
Before this change:
DELETE /observation/{id}removed only the row. Its lineage links, its id in other observations'related_observation_ids_json, and patterns built from it with their derived text all stayed.Now:
DELETE /pattern/{id}deletes a pattern of the calling agent (404 for another agent's) with its lineage links, and writes apatterndeletion receipt.linkreceipt), its id in other observations and in patterns, and any pattern left with no observation (with its ownpatternreceipt).observationandpatternreceipts removes the same set from a restored backup. It is idempotent in either receipt order.services/lineage_forgetting.py; the entity delete (fix: deleting an entity removes its history, events, edges, links and ids #63) uses them unchanged.Limit: a pattern that still has other observations keeps its text.
Tests:
tests/test_pattern_forgetting.py(3, all failing on main): route delete, another agent's 404, replay into a restored copy. Locally: every observation, pattern, recovery, deletion, forgetting, lineage, entity and reset test, 101 passed; ruff, types, sizes and package boundaries ok.