Skip to main content

Crate solo_steward

Crate solo_steward 

Source
Expand description

Solo steward: consolidation pass (SWS-equivalent dedup, REM-equivalent integration, decay sweep, reconsolidation).

Per ADR-0002, Steward is a struct, not a trait. The LLM backend is the swap point (via solo_core::LlmClient); the consolidation logic lives in one place.

§v0.2 status

  • cluster_episodes (this commit): pure-deterministic SWS pass. See cluster for the algorithm + tests. Implementation does not call the LLM and does not touch the DB — caller pairs (Episode, Embedding) from SQL upstream.
  • abstract_cluster: TODO — REM-equivalent LLM call to produce a SemanticAbstraction for each cluster. Will go in crate::abstraction when added.
  • detect_contradiction: TODO — bi-temporal SQL filter + LLM judge for ambiguous cases. Will go in crate::contradiction.

Storage wiring (writer → cluster → SQL persistence) lands in solo-storage separately.

Modules§

abstraction
REM-equivalent integration: ask the LLM to produce a semantic abstraction for one cluster of related episodes.
cluster
Pure-deterministic episode clustering — the SWS-equivalent dedup pass that opens every consolidation cycle.
contradiction
Contradiction detection between two triples — the third stage of consolidation per ADR-0002. Two-stage:

Structs§

ExtractTriplesBatchOutcome
v0.10.1 (P4 audit m5): outcome of Steward::extract_triples_batch.
Steward
StewardConfig

Constants§

ENV_ABSTRACTION_MAX_TOKENS
Env var name for tuning the abstraction LLM call’s max_tokens request. Must be a positive integer in [1, 65_536] (upper bound catches typo’d values like 1_000_000 that would silently inflate per-call cost). Default 512.
ENV_CLUSTER_COSINE_THRESHOLD
Env var name for tuning the centroid-cosine threshold used by every clustering / existing-merge / merge-candidate count site. One knob governs them all to preserve the SQL-sync invariant between the writer’s existing-merge and the doctor’s count (see solo_storage::merge_candidates module docstring).
ENV_CLUSTER_MIN_SIZE
Env var name for tuning the minimum cluster size (number of episodes) below which a candidate cluster is discarded by the SWS-equivalent clustering pass. Must be a positive integer. Default 3.
ENV_CONTRADICTION_CHECK_ENABLED
Env var name for the contradiction-detection toggle. true or false, case-insensitive. When false, the consolidation pass skips the rule filter + LLM judge entirely and contradictions_found stays 0. Useful for cost-constrained operators willing to lose contradiction tracking. Default true.