Repository navigation
feat: accept author on remember over HTTP, MCP and the CLI (#1427 phase 2, part 2) - #1493
Merged
Merged
Conversation
…n export and import (#1427 phase 2, part 2)
🔍 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 2 of #1427 phase 2 (attribution); part 1 (schema v22,
memories.author,Uteke::set_author) is #1492. The contract question is uteke-cloud#219, answered: cloud already hasmemories.authorsince contract 0.12.0 (same name and meaning, per agent, free text) and has no objection; its limit is 100 characters today and it is raising it to 128 to match.RememberRequest::decode, all transports):authoris validated (trimmed, 1 to 128 characters, no control characters) before any write, afterauthor_typeand beforetype.POST /rememberacceptsauthorwithout a room (it used to be an unknown key, 400), stores it on the memory and echoes it in the response when set. The error is a 400 and nothing is stored when it is invalid.POST /room/rememberalso stamps the named writer on the memory; theuserfallback of the room link is not an author, and an author the room link takes but the memory field rejects leaves the memory unattributed instead of failing a write that succeeded (Uteke::set_author_if_valid).uteke_rememberstoresauthorwith or withoutroom(decoded and validated before the write, so an invalid one is a tool error and nothing is stored); the schema text says so.uteke remember --authorworks without--room, is validated before the write, shown in--json, and forwarded to the server in server mode.ExportEntrycarriesauthor(omitted when unset); an invalid author in a file is dropped without failing the row; files from older versions import as before.docs/api-reference.mdregenerated (authoron the remember request);docs/core-contract.jsonis unchanged. CHANGELOG "Added" entry and the CLI reference updated.Filtering by author is not part of this phase.
Why
Agent identity lived in namespaces and, for room writes, on the room link only. #1427 steps toward one brain per database:
authoris where agent identity goes, usable everywhere a memory is written.Testing
author_is_validated_and_trimmed(both policies, the 128 bound, error order),test_author_survives_export_import(round trip, invalid author dropped, old rows).handlers/author_tests.rs):/rememberwith and without an author (echo,GET /memory,/list), four invalid authors give a 400 and store nothing, room remember stamps the writer and leaves the unnamed and the over-long cases unattributed. The old cross-surface test that pinnedauthoras rejected by the server now pins that the CLI body is accepted.tests/author_flag.rs, spawns the binary):--authorrecorded, shown bygetandlist; invalid values fail with--authorin the message and store nothing.remember_takes_an_author_without_a_room_and_returns_it; a decode that skips author validation failsauthor_is_validated_and_trimmed.cargo test --workspaceandcargo clippy --workspace --all-targets -D warningsare clean.