Repository navigation
feat(core): memories.author column, schema v22 and Uteke::set_author (#1427 phase 2, part 1) - #1492
Merged
Merged
Conversation
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
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
Part 1 of #1427 phase 2 (attribution): the storage side only. No HTTP, MCP or CLI input accepts
authoryet.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;authoris 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_authorandUteke::set_author(id, Option<&str>)set or clear it, mirroringset_author_type.Memory { .. }literals across the workspace gainauthor: None. CHANGELOG entry added.Part 2 (HTTP, MCP and CLI accept
authorwithout 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
authorexists 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 toauthor.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.authorthrough every reader (get_by_id,get_by_ids,load_all,list,search_content, time-travel lists, ...) and the column-macro test counts 24 columns.cargo test --workspaceandcargo clippy --workspace --all-targets -D warningsare clean.