Repository navigation
feat(core): rejected-value tombstone, so a value forgotten as wrong cannot be written again - #1627
Merged
Merged
Conversation
…annot be written again A forget or supersede with the reason 'wrong' (or 'wrong: <note>') records the sha256 of the normalised text (NFKC, case folding, whitespace collapsed, invisible characters removed) in the new rejected_values table (schema v23). commit_memory, the write tail of remember, room remember, import and consolidation, refuses that text with Error::RejectedValue, as do update and import --full; import skips and counts the row (rejected_tombstone). HTTP answers 409 rejected_value with the recorded reason, never the value; MCP a rejected_value: tool error. DELETE /forget and uteke_forget take a reason. Tombstones survive prune, travel with export/import --full, and are managed with uteke tombstone list|remove; promote removes the tombstone of the memory it restores. Ordinary forgets record nothing. Owner decisions and design: docs/plans/2026-11-01-rejected-value-tombstone-1597.md. CORE contract issue: uteke-cloud#437. Closes #1597
- import --full skips the room links, edges and timeline events of a row it rejects (the junctions have a foreign key on memories, so the whole import used to roll back); a graph node keeps its entity without the memory link. A database error during the check is no longer counted as a rejection. - supersede records the tombstone inside its transaction. - promote removes the tombstone by the restored text, so one recorded by a duplicate memory goes too. - normalise also drops variation selectors and tag characters. - restored tombstones must carry a SHA-256; tombstone list slices safely. Tests for each, plus percent_decode and 409 on PUT /memory and /room/remember.
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
This was referenced Nov 1, 2026
ajianaz
added a commit
that referenced
this pull request
Nov 8, 2026
… (#1690) * fix(import): import a live row whose content was only forgotten (#1689) A plain forget soft-deletes (deprecated=1) and is recoverable; only forget --reason writes rejected_values and rejects (#1627, untouched). #1633/#1636 made import skip any row whose content matched a soft-deleted one, so re-importing after a forget (restored backup, the LongMemEval harness forgetting after each question) dropped the rows. An anonymous live row over a forgotten copy now inserts as a new live row. Still skipped: a row carrying the forgotten memory's own id, a row marked deprecated in the file, and exact duplicates of live rows. * bench: LongMemEval-S 500Q receipts for the import tombstone-skip fix (#1689) Full 500-question run on Modal (10 shards, strategy default, binary built from 32a5cf3, ORT lib from v0.23.0), app ap-HNerZq2X0lO17WJ0CytCfb, 28129s wall clock. any@5 0.9820, strict@5 0.8800, misses@50 0, strict@5 flips -0/+0 vs the committed v0.20.0 baseline - all audit gates of #1689 pass. --------- Co-authored-by: ajianaz <[email protected]>
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
A rejected-value tombstone (schema v23): a value forgotten as wrong cannot be written again.
uteke forget <id> --reason wrong(orwrong: <note>),supersede --reason wrong,DELETE /forget?id=..&reason=..(LAB) and the MCPuteke_forgetreasonrecord the SHA-256 of the normalised text inrejected_values. Normalisation is NFKC, lowercase, whitespace collapsed, and invisible characters removed (zero-width, BOM, soft hyphen, variation selectors, tag characters). An ordinary forget records nothing.commit_memory, the write tail ofremember, room remember, import and consolidation, and also early inremember(before the embedding work), inupdate, and inimport --full.Error::RejectedValue. HTTP answers409 {"error": "rejected_value", "reason": ...}(never the value), and MCP returns arejected_value:tool error.importskips and counts the row (rejected_tombstone).import --fullalso skips its room links, edges and timeline events.uteke tombstone listanduteke tombstone remove <hash-prefix|memory-id>.uteke promoteremoves the tombstone of the text it restores.pruneand travel withexport --full/import --full.docs/plans/2026-11-01-rejected-value-tombstone-1597.md, CLI reference ("Rejecting a wrong value",uteke tombstone), architecture schema history, both skill copies, CHANGELOG.Why
Closes #1597 (Atlas findings 1 and 9, tracked in #1601). Forgetting was not durable:
The owner decided on 2026-11-01 (recorded on the issue):
wrong;CORE contract.
POST /remember,/room/remember,/importand/consolidate/pairgain the 409, and/importgainsrejected_tombstonewhen it is non-zero. A store with nowrongforget behaves exactly as before. Contract issue: uteke-cloud#437 (Gitea), opened before this PR; its answer (whether Cloud adopts the semantics) does not block OSS, but the release pre-flight should read it.Testing
cargo test --workspace: 1397 passed, 0 failed.cargo clippy --workspace --all-targets -D warningsandcargo fmt --checkclean.cargo run -p docgenleaves the generated docs unchanged.Core (
tombstone.rs).wrongreason parser.wrongrecords inside its transaction.--fullround trip, including a rejected row that has a room link, an edge and events (no foreign-key abort, no orphans).Server.
reason=wrong%3A+...onDELETE /forget, then 409 on/remember(case and spacing changed, value not echoed),PUT /memoryand/room/remember./importcount; an ordinary forget and an import with no tombstone leave the responses unchanged.Forget request and MCP.
percent_decodeon the reason only (ids keep the old rule; invalid and trailing escapes, multibyte). MCP:uteke_forgetwith a reason, then arejected_value:error.Manual (debug build). remember,
forget --reason "wrong: it is 8767", then remember with different case is refused with the reason;tombstone listshows it,tombstone remove <id>, and remember works again.Review. Local
cora reviewfound an unchecked hash slice intombstone list(fixed). A separate reviewer agent found three bugs, all fixed with tests:import --fullaborted on a rejected row with dependents;Cora is clean after the fixes.