Expand description
Which accounts a record names.
A write names somebody whenever it carries their DID: a reply’s parent
and root, a quote embed, a mention facet, the subject of a follow, a
like or a repost, the parent on a registration. plan/ai-preference.md
asks the question this module answers — given a record, which DIDs does
it name? — because a rule about being named needs the list before it
can look anybody up.
§Why this walks the record instead of holding a table per collection
A table of “these fields of these collections carry a DID” is a list that goes out of date on its own. A collection nobody added a row for names nobody, silently, and so does a field added to a lexicon after the row was written — and both failures point the same way: a write that should have been checked is not. Walking the record instead makes the answer structural. There is no row to forget, a new lexicon is covered the day it exists, and a field that starts carrying a DID is covered by the same code that covered the old one.
The cost is that it names somebody a narrower reading would not: a DID
in a field that is about them rather than addressed to them still
counts. That is the direction to err in for a rule about not naming
people, and it is the reading plan/ai-preference.md settles on.
Constants§
- MAX_
DEPTH - How deep into a record this walks.
Functions§
- did_in 🔒
- The DID a string is, or the DID an
at://URI’s authority is. - mentioned 🔒
- The
(did, handle)pairs one facet overtextcarries. - named_
accounts - Every account
recordnames, by DID, in the order they are first met and without repeats. - named_
handles - The handle
recorditself calls each account it mentions by, as(did, handle)pairs in the order they are first met. - walk 🔒
- walk_
handles 🔒