Skip to content

feat: accept author on remember over HTTP, MCP and the CLI (#1427 phase 2, part 2) - #1493

Merged
ajianaz merged 1 commit into
developfrom
feat/author-on-every-transport
Oct 16, 2026
Merged

ajianaz merged 1 commit into
developfrom
feat/author-on-every-transport

Conversation

@ajianaz

@ajianaz ajianaz commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator

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 has memories.author since 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.

  • Shared decode (RememberRequest::decode, all transports): author is validated (trimmed, 1 to 128 characters, no control characters) before any write, after author_type and before type.
  • HTTP: POST /remember accepts author without 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/remember also stamps the named writer on the memory; the user fallback 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).
  • MCP: uteke_remember stores author with or without room (decoded and validated before the write, so an invalid one is a tool error and nothing is stored); the schema text says so.
  • CLI: uteke remember --author works without --room, is validated before the write, shown in --json, and forwarded to the server in server mode.
  • Export and import: ExportEntry carries author (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.md regenerated (author on the remember request); docs/core-contract.json is 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: author is where agent identity goes, usable everywhere a memory is written.

Testing

  • Core: author_is_validated_and_trimmed (both policies, the 128 bound, error order), test_author_survives_export_import (round trip, invalid author dropped, old rows).
  • HTTP (handlers/author_tests.rs): /remember with 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 pinned author as rejected by the server now pins that the CLI body is accepted.
  • MCP: author with and without a room, invalid authors refused before anything is stored (count stays 0).
  • CLI (tests/author_flag.rs, spawns the binary): --author recorded, shown by get and list; invalid values fail with --author in the message and store nothing.
  • Mutation checks, then reverted: an HTTP handler that never stores the author fails remember_takes_an_author_without_a_room_and_returns_it; a decode that skips author validation fails author_is_validated_and_trimmed.
  • cargo test --workspace and cargo clippy --workspace --all-targets -D warnings are clean.

@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 a2e7b50 into develop Oct 16, 2026
15 checks passed
@ajianaz
ajianaz deleted the feat/author-on-every-transport branch October 16, 2026 07:22
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