Skip to main content

Module directory

Module directory 

Source
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§

DirectoryCategory
A directory category — an organisational unit / group (AD-style). Built-in ones are always present; users can add their own.
DirectoryEntry
One unified addressbook entry (a Party), joined across the directory-actor + chat-contact stores by DID.
DirectorySearchResult
A search result: the ranked matching entries, the facet counts (drill-down), and the categories.
DirectoryView
The whole categorised directory returned to the UI.
Facet
A facet (a filterable dimension of the directory) and its values.
FacetValue
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_view wires it to the persisted stores.
builtin_categories
The built-in categories. people is 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).