Skip to content

feat(api): room rename, room update, memory room-move + CLI memory update - #1203

Merged
ajianaz merged 2 commits into
developfrom
feat/room-ops
Sep 7, 2026
Merged

ajianaz merged 2 commits into
developfrom
feat/room-ops

Conversation

@ajianaz

@ajianaz ajianaz commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

What

Implements the remaining gaps from #1202 (audited against code first — items 4 and the API side of item 5 already existed):

  • Room rename (Uteke::rename_room(old, new)): rewrites the registry row and every room_memories / room_documents reference in ONE transaction. The FKs are ON DELETE CASCADE only (no ON UPDATE), so the implementation uses an FK-safe insert-new-row → repoint-children → delete-old-row order. Title, description, and namespace are preserved; errors on missing source or taken target (Error::Validation).
  • Room update (Uteke::update_room(id, title?, description?)): edits title and/or description, None = keep current. Adds the additive rooms.description column via schema v19 (fresh stores get it in CREATE TABLE; existing stores migrate with a guarded ALTER TABLE). Structural export now carries the 6th column and import accepts both 5- and 6-column exports.
  • Memory room-move (Uteke::move_memory_to_room(id, from, to)): rooms are many-to-many (room_memories PK (room_id, memory_id)), so the move reads the link's provenance, then delete+insert in one transaction — author/role/joined_at travel with the link. Ok(0) when the memory is not a member of from; target room must exist; same-room moves rejected.
  • uteke update <id> CLI: in-place memory edit (content/tags/importance/pinned/type). The facade (Uteke::update_memory), HTTP (PUT /memory), and MCP (uteke_update) surfaces already existed — this closes the CLI-only gap (feat(api): room rename, room update (title/description), memory room-move + CLI memory update #1202 item 5).

Surfaces per op (mirrors the #1183 pattern): HTTP POST /room/rename ({from, to}), POST /room/update ({room_id, title?, description?}; 404 when room missing), POST /room/memory/move ({memory_id, from_room, to_room}; 404 when the link is absent); CLI uteke room rename <old> <new>, uteke room update <id> [--title ...] [--description ...], uteke room move-memory <id> --from <room> --to <room>, uteke update <id> [--content ...] [--tags ...] [--importance ...] [--pinned ...] [--type ...]; MCP uteke_room_rename, uteke_room_update, uteke_room_memory_move.

Why

Fleet ops across many agents/projects need room lifecycle management: renaming a room today means create-new + re-remember everything, which breaks anything referencing the room name (agent routing config, memory hooks, channel-mirror conventions). link_memory_to_room had no reverse, so consolidating rooms was impossible without losing link provenance. rooms had no description column and no metadata edit path. Closes #1202 (items 1, 2, 3, 5-CLI).

Testing

  • 8 new unit tests in uteke-core (rooms::tests): rename moves registry + member links (author-filterable recall on the new ID), rename preserves document links, rename rejects missing source / taken target / same-ID, update sets title+description independently (and None for missing room), move preserves link provenance (verified via direct SQL on room_memories), move rejects missing target room / same-room. Schema-migration test updated: MAX(version) now asserts 19.
  • 2 new HTTP roundtrip tests in uteke-server: room_rename_update_move_endpoints_roundtrip (full flow: create → room/remember → rename → update → move → 404 on double-move) and room_update_missing_room_returns_404.
  • Local CI replication: cargo fmt --check clean; cargo clippy --workspace --all-targets -- -D warnings clean; full cargo test --workspace green.

…date (#1202)

- rename_room: registry row + room_memories + room_documents move in one
  transaction (FK-safe insert->repoint->delete; FKs are ON DELETE CASCADE
  only, no ON UPDATE)
- update_room: title/description edit; schema v19 adds additive
  rooms.description column (fresh + migrated stores); structural
  export/import carry it, backward-compatible with 5-column exports
- move_memory_to_room: M2M move preserving link author/role/joined_at
  provenance; Ok(0) when not a member of source
- uteke update <id> CLI: in-place memory edit closing the CLI surface gap
- Surfaces: HTTP /room/rename|update|memory/move, CLI room
  rename|update|move-memory + update, MCP uteke_room_rename|update|
  memory_move; api_registry + docgen regenerated

Closes #1202
@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-code · BYOK · MIT

CI runners have no ONNX runtime — Uteke::open() lazy-init fails there.
open_with_backend(path, None) matches the namespace_management_tests
pattern; these ops never touch embeddings anyway.
@ajianaz
ajianaz merged commit c399678 into develop Sep 7, 2026
16 checks passed
@ajianaz
ajianaz deleted the feat/room-ops branch September 7, 2026 13:38
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.

feat(api): room rename, room update (title/description), memory room-move + CLI memory update

1 participant