Repository navigation
fix(facets): remove tags when their targets are deleted - #500
Merged
Merged
Conversation
Generated-By: gpt-6.1-terra
Generated-By: gpt-6.1-terra
Keep both documented contracts and verify Facet mutation ordering against the landed Relation export and restore paths. Refs: #475 Generated-By: gpt-6.2-sol
Keep tags on missing targets when a delete candidate is stale. Update Lesson Recall before cleanup can yield and retain deleted IDs across purge chunks. Include empty stored keys on the first SQLite page. Refs: #475 Generated-By: gpt-6.2-sol
Owner
Author
|
Code review: standard scan, clean. Axes: Standards+Spec, Correctness/Logic Reviewed-Head: e22c073 |
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.
Intent
Closes #475
Ordinary hard deletes remove Facets attached to the deleted Observations, Memories, and Lessons.
Read first
src/functions/facets.ts:18— paged target-to-key lookup and invalidation.src/functions/facets.ts:84— deletion and best-effort Facet cleanup under the Facet lock.src/functions/export-import.tsandsrc/functions/snapshot.ts— Facet writes use the same lock without changing replacement semantics.src/functions/lessons.ts:352— update Recall before Facet cleanup can yield; retain cleanup IDs across purge chunks.src/engine/inproc/state.ts:307— include imported empty keys on the first page without losing indexed paging.Decisions
Out of scope
Verified
e22c0730: clean install, build, generated hooks, skills, typecheck,npm test(3,311 passed, one skipped),npm run eval:gate, andnpm run eval:gate:rules.Not verified
Merge danger
Door: One-way for Facets removed with their targets; a revert does not recreate deleted tags.
Blast radius: Ordinary Observation, Memory, and Lesson deletion paths; Facet mutation ordering during import and snapshot restore.