You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(ingestion): resolve Slack authors by real_name, not display_name (#580)
* fix(ingestion): resolve Slack authors by real_name, not display_name
Slack messages store author ids, so every speaker, @mention, and DM label
is resolved through the export's users.json roster. That lookup preferred
profile.display_name, which in a real export is frequently a short handle
("morgan"). Zep merges entities by the names it sees in text, so a handle
never merges with the same person written in full ("Morgan Lee") in an
email or document: one person silently becomes two nodes, and half their
facts hang off each. Verified against a live graph — ingesting a
handle-based export alongside full-name documents produced both 'morgan'
and 'Morgan Lee' as Person nodes; after this change it produces one.
Prefer real_name, then display_name, then the username, then the raw id.
Slack's own precedence is the opposite, but it optimizes for how a name
reads in a chat client, not for entity resolution.
Report authors whose roster entry has no real_name, counting only those
whose content was actually ingested (including via an @mention) so a
handle-only user who never posted is not noise. Expose the raw Slack id
as SlackMessage.user_id so formatter= can substitute names from a
directory of your own when the roster is thin.
Both fixtures previously wrote display_name so it could never behave like
a display name — the example roster left it empty and the test roster put
a full name in it — which is why this went unnoticed. They now carry
realistic handles, making the fixtures a regression guard: reverting only
the loader change fails nine tests.
Co-Authored-By: Claude <noreply@anthropic.com>
* fix(ingestion): report weak Slack names that reach the graph via a DM label
A DM or group DM is labeled by its members, and that label is written into
every episode's text and metadata. It is built straight from the roster in
_label(), never through _resolve(), so a member whose only name is a handle
was put into the graph untracked: if they never authored a message and were
never @mentioned, _weak_names stayed empty and no warning was emitted.
Carry the roster ids a label names on _Conversation and record the weak ones
in _load_conversation, which is the first point that knows the conversation
was both selected and non-empty. Recording them in _label() instead would
warn about members of a conversation the run skipped — a private DM excluded
by the default conversation_types — and recording them on selection alone
would warn for a selected folder that yielded no episodes.
The warning now says "named in ingested content" rather than "whose content
was ingested", which no longer fits a member who never posted.
Co-Authored-By: Claude <noreply@anthropic.com>
* fix(ingestion): only report weak Slack names from messages that were kept
_normalize_text resolves @mentions, and it runs before a message is known to
be usable: the ts / thread_ts checks come after it, and the duplicate-ts drop
happens later still in _load_conversation. A handle mentioned only by a
message this run threw away therefore landed in _weak_names, and the warning
claimed it was named in ingested content when nothing of it reached the graph.
Buffer weak names per message in _parse and promote them in
_load_conversation once the message is accepted. Buffering rather than
reordering _parse keeps the existing skip precedence intact — moving the ts
checks above the empty-text check would start counting _invalid_ts for
messages dropped for having no text.
_unresolved_users deliberately keeps recording immediately: it reports ids
"referenced in messages", which is true whether or not the message survived,
whereas a weak name is reported as "named in ingested content".
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
0 commit comments