1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// SPDX-FileCopyrightText: 2026 Andrei G <bug-ops>
// SPDX-License-Identifier: MIT OR Apache-2.0
// The graph-retrieval-strategy dispatch in `helpers::fetch_graph_facts` chains several
// nested async fns (`run_graph_strategy`, `run_synapse_strategy`, `run_hybrid_strategy`, ...),
// which pushes the compiler's Future-layout query depth beyond the default limit of 128.
// This only manifests with the `full` feature bundle combined with `postgres` at the
// *workspace* level (`cargo check --workspace --all-targets --no-default-features
// --features full,postgres`) — `full` pulls in additional dependent crates (candle, pdf,
// scheduler, tui, acp, gateway, a2a, otel, prometheus) whose types push the query depth
// further than `postgres` alone. A crate-scoped build (`-p zeph-agent-context --features
// postgres`) does NOT reproduce this; always verify against the workspace+full+postgres
// combination before touching this attribute again.
//! Agent context-assembly service for Zeph.
//!
//! This crate provides [`service::ContextService`] — a stateless façade for all
//! context-assembly operations that were previously implemented directly on `Agent<C>`
//! in `zeph-core`. Extracting this logic means that editing context-assembly code does
//! not trigger recompilation of the tool dispatcher (`zeph-agent-tools`) or the
//! persistence layer (`zeph-agent-persistence`).
//!
//! # Architecture
//!
//! `zeph-agent-context` depends on `zeph-memory`, `zeph-llm`, `zeph-context`,
//! `zeph-config`, `zeph-common`, `zeph-skills`, and `zeph-sanitizer`. It does **not**
//! depend on `zeph-core` — this is the core invariant that keeps context-assembly
//! changes from triggering full workspace rebuilds.
//!
//! `zeph-core` depends on this crate and constructs narrow borrow-lens views
//! ([`state::MessageWindowView`], [`state::ContextAssemblyView`],
//! [`state::ContextSummarizationView`]) from `Agent<C>` field projections, then
//! delegates to `ContextService`.
//!
//! # Features
//!
//! - `index` — enables `zeph-index` integration via the `IndexAccess` trait.
pub use ;
pub use ContextError;
pub use BudgetHint;
pub use ;
pub use ;
pub use ;