Expand description
Drawer creator-attribution tag helpers.
Why: prior to this module, drawers carried content, room, importance,
and free-form tags but no first-class metadata describing the writer.
Operators who saw noise drawers in a palace had no way to trace which
client wrote them — was it the trusty-memory MCP, a curl from a shell
script, claude-mpm’s Python hook, the dashboard form? This module
defines a reserved creator:* tag namespace that every write path
(HTTP, MCP, CLI, hook) attaches automatically. With creator:client=…
present on every drawer, “where did this come from?” becomes
grep-able. The namespace approach (vs. a Drawer schema change)
piggy-backs on the existing msg: tag pattern from #99 so no
migration is required.
What:
CREATOR_*_PREFIXconstants — the four reserved tag prefixes.CreatorInfo— small value type carrying client name, version, source, and optional cwd.into_tags()renders the four tag strings (or three, when cwd is absent) in a stable order.is_creator_tag— predicate used by UI render code that wants to hide the namespace from the main tag chips (mirroring howmsg:*is filtered today).
Test: see the tests module at the bottom — covers tag composition,
prefix detection, and round-trip via is_creator_tag.
Structs§
- Creator
Info - Value type describing the writer of a drawer.
Enums§
- Creator
Source - Originating-subsystem labels emitted into
creator:source=.
Constants§
- CLI_
CLIENT_ NAME - Client name attached to drawers written by the
trusty-memoryCLI. - CREATOR_
CLIENT_ PREFIX - Tag prefix carrying the writing client’s short name
(e.g.
creator:client=trusty-memory-mcp). - CREATOR_
CWD_ PREFIX - Tag prefix carrying the writing process’ cwd at write time
(e.g.
creator:cwd=/Users/alice/projects/foo). - CREATOR_
SESSION_ PREFIX - Tag prefix carrying the short session id of the writer (issue #202).
- CREATOR_
SOURCE_ PREFIX - Tag prefix carrying the originating subsystem (
http/mcp/hook/cli). - CREATOR_
VERSION_ PREFIX - Tag prefix carrying the writing client’s version string
(e.g.
creator:version=0.5.1). - HOOK_
CLIENT_ NAME - Client name attached to drawers written by hook-driven code paths.
- HTTP_
DEFAULT_ CLIENT - Default client name used when an HTTP caller omits the
X-Trusty-Client-Nameheader. - MCP_
CLIENT_ NAME - Client name attached to drawers written by the MCP tool surface.
- X_
TRUSTY_ CLIENT_ CWD - HTTP request header carrying the writing client’s cwd.
- X_
TRUSTY_ CLIENT_ NAME - HTTP request header carrying the writing client’s short name.
Functions§
- is_
creator_ tag - Return
truewhen a tag belongs to thecreator:*reserved namespace. - session_
tag_ from_ tags - Build a
creator:session=<first-8-chars>tag from the first bare UUID found intags, if any (issue #202).