Repository navigation
fix: delete and restore name the ids they skip, like archive - #387
Merged
Merged
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.
Summary
/admin/notes/deleteand/admin/restorerefuse an id they cannot find the way/admin/archivedoes: a 400 that counts the ids and lists them asmissing. The check runs before both the preview andconfirm, so nothing changes when one id is wrong.restorestill looks rows up withoutnotes_only, so archived document chunks stay restorable. The MCP toolsdelete_notesandrestore_notesrelay the RESTerrorstring unchanged, so agents see the ids without a tool change. The README rows for the two routes state the refusal.Not changed here:
link_entitiesreports its own refusal under the keyids, notmissing.Related issues
Closes #340
Runtime evidence (required for ingest / retrieval / serving behavior)
Real REST app against the throwaway Postgres container (a temporary integration test, not committed), with one seeded agent note and one unknown id:
RED before the fix (
-k cannot_find):KeyError: 'missing'(delete ×2),assert 200 == 400(restore ×2),4 failed.Verification
uv run pytestpasses: unittests/serve1051 passed, 1 skipped; integrationtest_archive_flow.py,test_facts_integration.py,test_consolidate_verdicts_integration.py19 passeduv run ruff format --check .anduv run ruff check .passdocker compose build mcppasses (Dockerfile / dependency changes) — N/A, no dependency changeChecklist (core principles)
doc_rowsand theturnslane.envskip-testslabel justified)