Expand description
Personal directory — an “Active Directory”-like service for a person’s relationships.
It hosts the addressbook (Parties) organised into categories (organisational units / groups —
a Party may be in several, like AD groups), and is the home for the agreements governing each
relationship. It unifies the two pre-existing stores — directory Actors and
chat ChatContacts — into ONE categorised view joined by pairwise
DID, without a destructive migration: it reads both and persists only the additive parts (custom
categories + per-entry category assignments) in their own files under app_meta_dir.
Agreement links are surfaced per entry from the first-class agreement store (crate::agreements) —
see docs/plans/rights-aware-peer-agreement-addressbook.md. This module is the P0 foundation of
that plan (the directory that hosts the addressbook); the agreement store is P1, and
build_view_core joins the two by DID so each Party carries the ids of the Agreements governing its
relationship.
Structs§
- Directory
Category - A directory category — an organisational unit / group (AD-style). Built-in ones are always present; users can add their own.
- Directory
Entry - One unified addressbook entry (a Party), joined across the directory-actor + chat-contact stores by DID.
- Directory
Search Result - A search result: the ranked matching entries, the facet counts (drill-down), and the categories.
- Directory
View - The whole categorised directory returned to the UI.
- Facet
- A facet (a filterable dimension of the directory) and its values.
- Facet
Value - One selectable value within a facet, with its count in the current result and whether it’s selected.
Functions§
- build_
view - Build the unified, categorised directory view over the persisted directory-actor + chat-contact stores, joined against the persisted agreement store so each entry carries its governing agreement ids.
- build_
view_ core - Pure core: merge directory actors + chat contacts into one categorised view, given the persisted
category assignments and the category list. Kept pure (no filesystem) so it is deterministically
testable;
build_viewwires it to the persisted stores. - builtin_
categories - The built-in categories.
peopleis the catch-all every entry falls into. - create_
category - Create a custom category. Idempotent by slug; errors if the slug already exists.
- list_
categories - All categories: built-in + user-created.
- search
- Search the persisted directory: build the unified view, then run
search_core. - search_
core - Pure search core: rank entries by a concept-expanded query and narrow by selected facets, returning the entries plus drill-down facet counts. Kept pure (no filesystem) for deterministic testing.
- set_
entry_ categories - Set the categories an entry (by DID) belongs to. Unknown category ids are dropped; an empty set clears the explicit assignment (the entry falls back to inferred categories).