memory.federation¶
memory.federation ¶
Read-only federation helpers for projecting related memory trees.
FederatedRepo
dataclass
¶
federation_cache_root ¶
Directory holding decrypted bundle caches (one subdir per synced peer).
Anchored at <root>/.angelo/federation-cache where root defaults to
the workspace root — the same anchor :func:configured_repos uses. Both the
sync writer (CLI) and this reader resolve the cache to the same place.
Source code in memory/federation.py
configured_repos ¶
configured_repos(config: dict[str, Any] | None = None, root: Path | None = None) -> tuple[list[FederatedRepo], list[dict[str, str]]]
Return enabled, valid federated repos plus non-fatal validation errors.
Source code in memory/federation.py
read_repo ¶
read_repo(repo: FederatedRepo) -> dict[str, Any]
Read a related repo's .memory directory without mutating it.
Source code in memory/federation.py
latest_mtime ¶
Return the newest source-file mtime across configured federated repos.
Source code in memory/federation.py
repo_embeddings_path ¶
repo_embeddings_path(repo: FederatedRepo) -> Path
Path to a federated repo's embedding sidecar (.angelo/memory.embeddings.json).
coordinator_state_path ¶
coordinator_state_path(repo: FederatedRepo) -> Path
Path to a federated repo's coordinator run-state sidecar.
Mirrors the coordinator server's default layout: .angelo/coordinator-state.json
as a sibling of the repo's .memory directory — the directory we already
resolved for federation. Federation can't observe a peer's
COORDINATOR_STATE_FILE / ANGELO_DIR env overrides, so we assume the
default location (callers also probe the legacy fallbacks).
Source code in memory/federation.py
coordinator_state_candidates ¶
coordinator_state_candidates(repo: FederatedRepo) -> list[Path]
Ordered coordinator-state paths to probe for a federated repo.
Canonical .angelo location first, then the legacy .cassius and
repo-root fallbacks — the same precedence the local dashboard uses. Shared by
the read path (:func:read_coordinator_runs) and by cleanup writes so both
agree on which peer files hold run state.
Source code in memory/federation.py
read_coordinator_runs ¶
read_coordinator_runs(repo: FederatedRepo) -> list[dict[str, Any]]
Read coordinator run dicts from a federated repo, best-effort and read-only.
Probes the canonical .angelo location first, then the legacy .cassius
and repo-root fallbacks (same precedence the local dashboard uses). Returns an
empty list when no readable state file exists or none carries a modern
runs list — federation never raises on a missing/malformed peer.
Note: only the modern {"runs": [...]} format is understood here; the
legacy flat task-list format is intentionally not reconstructed for peers.
Source code in memory/federation.py
load_embeddings ¶
load_embeddings(repo: FederatedRepo) -> dict[str, list[float]]
Read a federated repo's embedding sidecar, namespacing keys to <repo_id>:<entry_id>.
Returns an empty dict when the sidecar is missing or malformed — federation is always best-effort and read-only.
Source code in memory/federation.py
latest_embeddings_mtime ¶
Return the newest embedding-sidecar mtime across configured federated repos.