Converge Core
A correctness-first, context-driven multi-suggestor runtime.
Converge is a Suggestor OS where:
- Context is the API
- Suggestors collaborate through data, not calls
- Execution proceeds until a fixed point
- Convergence is explicit and observable
Quick Start
use ;
use ;
// Create engine and register suggestors
let mut engine = new;
engine.register_suggestor;
engine.register_suggestor;
// Run until convergence
let result = engine.run.expect;
// Inspect results
assert!;
assert!;
assert!;
println!;
Core Concepts
- [
Context]: The shared, typed, evolving state of a job - [
Suggestor]: A capability that reads context and emits effects - [
AgentEffect]: Buffered proposal output from a suggestor - [
Engine]: The convergence loop that coordinates suggestors
Guarantees
- Determinism: Same input → same output
- Termination: Budgets prevent infinite loops
- Isolation: Suggestors never call each other
- Auditability: All changes are traceable
Design Tenets
These are the nine non-negotiable axioms that converge-core exists to encode,
enforce, and protect. Every type, trait, and pattern in this crate serves one
or more of these tenets.
1. Explicit Authority
Axiom: No defaults that grant authority. Authority is always explicit, typed, and traceable.
Why: Implicit permissions lead to security drift and unauditable systems.
In code: [AuthorityGrant] and [AuthorityScope] require explicit construction.
The pub(crate) constructors on AuthorityGrant prevent external code from forging
authority. See also [PromotionRecord] which traces approvers.
2. Convergence Over Control Flow
Axiom: We converge on outcomes via governed proposals, not ad-hoc loops or hidden heuristics.
Why: Control flow hides decisions; convergence makes them observable.
In code: The [Engine] runs suggestors repeatedly until a fixed point is reached.
[StopReason] exhaustively enumerates why execution halted. No hidden loops.
3. Append-Only Truth
Axiom: Facts are never mutated. Corrections are new facts.
Why: Mutable state hides history and prevents audit replay.
In code: [TypesFact] has private fields with no &mut methods.
[CorrectionEvent] creates new correction facts rather than
mutating existing ones. The [Context] accumulates facts without overwriting.
4. Suggestors Suggest, Engine Decides
Axiom: Suggestors emit proposals; promotion requires validation gates (and sometimes humans).
Why: Separates suggestion from decision, enabling governance and audit.
In code: [PromotionGate] is the ONLY path to create Facts. Suggestors produce
[Proposal] in the Draft state which must go through [ValidationReport]
before becoming Validated and finally [TypesFact].
5. Safety by Construction
Axiom: Make invalid states unrepresentable. Prefer types over conventions.
Why: Runtime checks can be bypassed; type-level guarantees cannot.
In code: The type-state pattern on [Proposal] (Draft vs Validated)
makes it impossible to promote an unvalidated proposal. Newtype IDs like [FactId],
[ProposalId], and [ObservationId] prevent mixing.
6. Transparent Determinism
Axiom: The system tells the truth about replayability and determinism.
Why: Hidden non-determinism corrupts audit trails and reproducibility.
In code: [TypesTraceLink] distinguishes [LocalTrace]
(replay-eligible) from [RemoteRef] (audit-only). [Replayability]
explicitly marks whether operations can be replayed deterministically.
7. Human Authority First-Class
Axiom: Explicit pause/approve gates for consequential actions.
Why: AI systems must preserve human oversight for high-stakes decisions.
In code: [Actor] and [ActorKind] distinguish
human from automated approvers. [PromotionRecord] records
who approved each fact. The [ValidationPolicy] can require human approval.
8. No Hidden Work
Axiom: No silent background effects, retries, implicit state changes, or shadow decisioning.
Why: Hidden work makes systems unpredictable and unauditable.
In code: [AgentEffect] explicitly captures all suggestor output. The [Engine]
budget system ([CycleBudget], [FactBudget], [TokenBudget]) makes resource
consumption visible. [StopReason] explains exactly why execution ended.
9. Scale by Intent Replication
Axiom: Scale by replicating intent and invariants across domains.
Why: Scaling should preserve governance, not bypass it.
In code: [RootIntent] and [Frame] capture intent as data.
[Invariant] enforces governance rules. These types can be serialized and
replicated across distributed systems while preserving their constraints.
Purity Declaration
converge-core is the constitutional foundation for Converge. It must remain
pure: no I/O, no runtime behavior, no implementation logic. Only types,
traits, and promotion gates.
Allowed Dependencies
| Crate | Purpose | Rationale |
|---|---|---|
thiserror |
Error derives | Pure derives, no runtime |
tracing |
Log macros | Compile-time only when used |
serde |
Serialization derives | Pure derives, no I/O |
serde_json |
JSON encoding | Value-only, no I/O |
typed-builder |
Builder derives | Pure derives |
hex |
Hex encoding | Pure transforms |
| Small pure libs | Hashing, encoding | No I/O, no async |
Forbidden Dependencies
| Crate | Category | Why Forbidden |
|---|---|---|
tokio |
Async runtime | Implies execution |
reqwest |
HTTP client | Network I/O |
axum |
HTTP server | Network I/O |
tonic |
gRPC | Network I/O |
prost |
Protobuf | gRPC dependency |
burn |
ML runtime | Heavy computation |
llama-burn |
LLM inference | Model execution |
fastembed |
Embeddings | Model execution |
polars |
DataFrames | Heavy computation |
arrow |
Columnar data | Analytics dependency |
lancedb |
Vector DB | Persistence |
surrealdb |
Database | Persistence |
postgres |
Database | Persistence |
rand |
Randomness | Non-determinism |
rayon |
Parallelism | Execution strategy |
The Purity Rule
If a module implies execution, I/O, network, model inference, or persistence, it does not belong in
converge-core.
Capability crates (e.g., converge-runtime, converge-llm, converge-provider)
implement the traits defined here using the forbidden dependencies.
See deny.toml at the crate root for CI enforcement of these rules.