Skip to content

feat(core): memories.author column, schema v22 and Uteke::set_author (#1427 phase 2, part 1) - #1492

Merged
ajianaz merged 1 commit into
developfrom
feat/memory-author-schema-v22
Oct 16, 2026
Merged

ajianaz merged 1 commit into
developfrom
feat/memory-author-schema-v22

Conversation

@ajianaz

@ajianaz ajianaz commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator

What

Part 1 of #1427 phase 2 (attribution): the storage side only. No HTTP, MCP or CLI input accepts author yet.

  • Schema v22 (additive): memories.author TEXT (nullable). The migration adds the column if it is missing and backfills it: a memory that belongs to exactly one room takes the author recorded on that room link; a memory in two or more rooms, in no room, or already attributed is left alone (never guessed). It is idempotent.
  • Memory.author: Option<String>, omitted from JSON when unset; author is read by position (index 23) through the shared column macros, and written by the INSERT.
  • types::validate_author: trimmed, 1 to 128 characters, no control characters (the room author bound). Store::set_author and Uteke::set_author(id, Option<&str>) set or clear it, mirroring set_author_type.
  • The 30 Memory { .. } literals across the workspace gain author: None. CHANGELOG entry added.

Part 2 (HTTP, MCP and CLI accept author without a room, drop the "author requires a room" rule, return it, keep it in export and import) waits for the cloud answer (uteke-cloud#219). Filtering by author stays out of this phase, as agreed.

Why

Today author exists only on the room link, so an agent can be recorded only when it writes into a room. #1427 steps toward one brain per database: agent identity moves from namespaces to author.

Testing

  • test_migration_v22_adds_author_and_backfills_single_room_links: a v21 store (column dropped, version set back) with one memory in one room, one in two rooms and one in none upgrades in place; only the single-room memory is backfilled; reopening changes nothing.
  • test_author_roundtrips_and_is_validated: insert and read back, set (trimmed), replace, clear, unknown id, empty, too long, a control character, the exact 128 bound, and JSON omission when unset.
  • The existing full-row test now also checks author through every reader (get_by_id, get_by_ids, load_all, list, search_content, time-travel lists, ...) and the column-macro test counts 24 columns.
  • Mutation check, then reverted: a backfill that also fills multi-room memories fails "two rooms: not guessed".
  • cargo test --workspace and cargo clippy --workspace --all-targets -D warnings are clean.
  • Upgrade note for 0.22.0: the first open migrates the store in place; back up a production store first, as for v21.

@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 7cafdcd into develop Oct 16, 2026
15 checks passed
@ajianaz
ajianaz deleted the feat/memory-author-schema-v22 branch October 16, 2026 06:45
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