Skip to content

refactor: MCP forget and id resolution follow the HTTP rules; uteke forget is the same locally and via a server (#1439, part F) - #1581

Merged
ajianaz merged 1 commit into
developfrom
refactor/unify-forget-1439
Oct 29, 2026
Merged

ajianaz merged 1 commit into
developfrom
refactor/unify-forget-1439

Conversation

@ajianaz

@ajianaz ajianaz commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator

What

Part F of #1439 (one behaviour across surfaces), the forget operation and id resolution:

  • ForgetPolicy::MCP is ForgetPolicy::HTTP: an unknown prefix is Memory not found: {id}; a full UUID that is not stored is refused (existence check, BUG: room_remember broken — remember_in_room() not exposed via HTTP AND tags causes 500 #762) on every surface instead of being passed to the core, which reported success. This also reaches uteke_get/update/pin/supersede through their shared resolver.
  • A full UUID is normalised to hyphenated lowercase on every surface. This loosens HTTP only: DELETE /forget?id= accepts an upper-case or dash-less spelling of a stored id (it was a 404). Nothing that succeeded before fails.
  • uteke_forget refuses undeclared arguments (tag, namespace) instead of ignoring them.
  • uteke forget <id> on a local store resolves prefixes and refuses an id that is not stored (it printed "forgotten" for any string).
  • uteke forget via a server asks for the same confirmation as locally (y/N prompt or --confirm; a tag forget without --confirm prints a notice and deletes nothing). --cold/--all via a server are an explicit error (no fallback to a local store, which would delete from the wrong database).
  • The documentation-only read_only_token_may_forget field is gone (the gate is an HTTP pipeline check).

Why

The surfaces diverged on the same request (#1439; owner decision 2026-10-13: unify towards HTTP). Forgetting is destructive, so the unknown-id and confirmation gaps mattered most.

Testing

  • cargo fmt, cargo clippy --workspace --all-targets --locked -- -D warnings, cargo test --workspace --locked, cargo run -p docgen (no diff).
  • Core resolution tests now assert one behaviour on both policies; MCP tests cover unknown prefix, absent full UUID, undeclared arguments; new CLI integration test forget_id (prefix resolves, unknown id/prefix refused).
  • Behaviour visible to scripts: via a server, uteke forget without --confirm no longer deletes (documented in the flag help since it existed locally); noted in the CHANGELOG.

…orget is the same locally and via a server (#1439, part F)

An unknown prefix and a stored-nowhere full UUID are both 'Memory not found'. Full UUIDs are normalised on every surface. uteke_forget refuses undeclared arguments. A local uteke forget resolves prefixes and refuses unknown ids. Via a server it asks for the same confirmation and refuses --cold/--all explicitly.
@github-actions

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-code · BYOK · MIT

@ajianaz
ajianaz merged commit d5b50b6 into develop Oct 29, 2026
14 checks passed
@ajianaz
ajianaz deleted the refactor/unify-forget-1439 branch October 29, 2026 04:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant