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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
// Copyright 2024-2026 Reflective Labs
// SPDX-License-Identifier: MIT
//! Backend identity and kind.
//!
//! Every external capability in Converge implements [`Backend`]. This trait
//! captures identity and capability declarations — not invocation. Each
//! backend kind has its own invocation traits in its own crate.
use ;
use crateCapability;
/// The kind of backend — which agent instantiation strategy it supports.
///
/// This is not a capability (capabilities are declared separately via
/// [`Capability`]). This is the *category* of the backend, used for
/// coarse routing before capability matching.
///
/// # Extensibility
///
/// The `Other(String)` variant allows future backend kinds without
/// breaking the enum. Use it for experimental or domain-specific backends.
/// Identity and capability declaration for any backend in the Converge platform.
///
/// This is the foundational trait that all backend implementations must satisfy.
/// It captures *who* a backend is and *what it can do*, not *how to call it*.
///
/// Specific invocation traits extend this in their own crates:
/// - `ChatBackend` / `EmbedBackend` in converge-core (canonical LLM interfaces)
/// - `PolicyEngine` in converge-policy (Cedar/OPA)
/// - `Solver` in converge-optimization (CP-SAT/Polar)
/// - `Pipeline` in converge-analytics (Burn/LanceDB)
///
/// # Thread Safety
///
/// Backends must be `Send + Sync` for use in concurrent agent execution.
///
/// # Example
///
/// ```
/// use converge_traits::{Backend, BackendKind, Capability};
///
/// struct MockLlm;
///
/// impl Backend for MockLlm {
/// fn name(&self) -> &str { "mock-llm" }
/// fn kind(&self) -> BackendKind { BackendKind::Llm }
/// fn capabilities(&self) -> Vec<Capability> {
/// vec![Capability::TextGeneration, Capability::Reasoning]
/// }
/// }
///
/// let backend = MockLlm;
/// assert_eq!(backend.kind(), BackendKind::Llm);
/// assert!(backend.has_capability(Capability::TextGeneration));
/// ```