Repository navigation
refactor(core): typed forget request shared by HTTP, MCP and CLI (#1343) - #1426
Merged
Merged
Conversation
Add uteke-core ForgetInput / ForgetPolicy / ForgetRequest and resolve_memory_id: DELETE /forget query parsing, id-or-tag decoding, id resolution (full UUID, prefix, ambiguity), the existence check and the CLI-via-server URL now live in one module. HTTP /forget, MCP uteke_forget (and the shared MCP resolve_id) and the CLI-via-server forget use it. Extraction only: where the surfaces disagree, each surface's current behaviour is a policy value; the read-only gate stays HTTP-only. Refs #1343 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
…get-1343 # Conflicts: # crates/uteke-core/src/lib.rs
This was referenced Oct 12, 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.
What
Second slice of #1343 (after
recall, #1423): a typedforgetrequest inuteke-core(crates/uteke-core/src/forget_request.rs:ForgetInput,ForgetPolicy,ForgetRequest,resolve_memory_id), used by:DELETE /forget: query parsing, id-or-tag decoding, id resolution and the existence check (BUG: room_remember broken — remember_in_room() not exposed via HTTP AND tags causes 500 #762).uteke_forgetand the shared MCPresolve_idhelper (also used by pin/get/update/supersede, same MCP policy as before)./forget?...URL is built byForgetInput::to_http_path.Extraction only. No route, shape, default, id-resolution or error-text change.
docs/core-contract.jsonanddocs/api-reference.mdare byte-identical aftercargo run -p docgen.Why
Each surface parsed, validated and resolved forget arguments on its own, so the same destructive operation was decided in three places. Where the surfaces disagree today the disagreement is now an explicit
ForgetPolicyvalue instead of an accident. Nothing became more permissive: every check that existed stays on the surface that had it.Surface disagreements (owner decisions, NOT unified here)
DELETE /forgetuteke_forget%and_reach theLIKEscan (soid=%is "ambiguous", or resolves when exactly one memory exists, and%<fragment>resolves by substring)-only (#1328)urn:/braced forms then 404 at the existence check)Memory not found: {id}No memory matches id prefix '{id}'?tag=plus optionalnamespace; no namespace means the DEFAULT namespace, not all--tag, namespacedefaultunless--namespaceProvide ?id= or ?tag= parameterMissing 'id'a%20bis literal)%or spaces never matches what was typed (pre-existing)uteke forgetprompts, via-server path ignores--confirmand does not promptThe read-only gate is a method/path check in the HTTP pipeline, so it cannot be a decode rule; it is recorded as
ForgetPolicy::read_only_token_may_forget(HTTP false, MCP true) and pinned by tests.Testing
cargo fmt --all --check,cargo clippy --workspace --all-targets -- -D warnings,cargo test --workspace,cargo test -p uteke-core --no-default-features --features "onnx,vecq" --lib: pass.cargo run -p docgen:docs/unchanged.forget_request: query parsing quirks, id-wins-over-tag, per-policy resolution (verbatim vs normalised, existence check, texts), charset check MCP-only, ambiguous text equal on both policies,to_http_path.forget_route_tests(in-processroute()): full id, short prefix, 404/400 texts, id-over-tag, tag namespace semantics, read-only token 403 with nothing deleted, HTTP vs MCP resolve to the same memory.tag/namespacekeys never widen the target./forget?...URL equals the old format incl. encoding.uteke-servebuilt fromorigin/developand from this branch, freshUTEKE_HOMEeach, auth token and read-only token, OpenAI-compatible fake embedder (768 dims), same 8 seeded memories (3 namespaces, 6 tags). 69 cases (no token, bad token, read-only token, wrong methods, missing/empty/bad-typed params, wildcards, unknown/ambiguous/absent/uppercase/simple/urn/braced ids, duplicates, id vs tag, tag with/without/wrong namespace, repeat forgets, path variants, final state of all namespaces) compared on status and id-normalised body: 69 compared, 0 differences. MCP and CLI were not differentially tested end to end (covered by the unit tests above).Refs #1343
🤖 Generated with Claude Code