UAT: ContextTierService warm and cold tiers use plain in-memory dicts — spec requires SQLite-backed warm tier and file-backed cold tier #5519

Open
opened 2026-04-09 07:11:45 +00:00 by HAL9000 · 0 comments
Owner

Summary

The ContextTierService stores all three tiers (hot, warm, cold) as plain in-memory Python dict objects. The spec requires the warm tier to be SQLite-backed and the cold tier to be file-backed for persistence across process restarts.

What Was Tested

Code-level analysis of src/cleveragents/application/services/context_tiers.py and docs/reference/context_tiers.md.

Expected Behavior (from spec)

Per docs/reference/context_tiers.md:

Tier Backend Latency Capacity
Hot In-memory Low Token-budget
Warm SQLite stub Medium Decision-count
Cold File stub High Decision-count

The warm tier should persist to SQLite so that decision history survives process restarts. The cold tier should persist to files for unlimited capacity.

Actual Behavior

In ContextTierService.__init__():

# --- tier stores ---
self._hot: dict[str, TieredFragment] = {}
self._warm: dict[str, TieredFragment] = {}  # ⚠️ Should be SQLite-backed
self._cold: dict[str, TieredFragment] = {}  # ⚠️ Should be file-backed

All three tiers are plain in-memory dicts. When the process restarts:

  • All warm-tier fragments (decision history) are lost
  • All cold-tier fragments (archived context) are lost
  • The plan-decision-context strategy cannot retrieve historical decisions from previous sessions
  • The temporal-archaeology strategy cannot retrieve archived context from previous sessions

Impact

  • Context history does not persist across process restarts
  • The warm/cold tier capacity limits (max_decisions_warm=500, max_decisions_cold=5000) are enforced in-memory only
  • The ContextTierService is described as single-threaded in its docstring, which is consistent with in-memory storage, but the spec requires persistence

Code Location

src/cleveragents/application/services/context_tiers.pyContextTierService.__init__(), _hot, _warm, _cold attributes.

Note

The docs/reference/context_tiers.md table labels warm as "SQLite stub" and cold as "File stub", suggesting this is a known planned improvement. This issue tracks the gap between the documented behavior and the actual implementation.


Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: uat-tester

## Summary The `ContextTierService` stores all three tiers (hot, warm, cold) as plain in-memory Python `dict` objects. The spec requires the warm tier to be SQLite-backed and the cold tier to be file-backed for persistence across process restarts. ## What Was Tested Code-level analysis of `src/cleveragents/application/services/context_tiers.py` and `docs/reference/context_tiers.md`. ## Expected Behavior (from spec) Per `docs/reference/context_tiers.md`: | Tier | Backend | Latency | Capacity | |------|---------|---------|----------| | Hot | In-memory | Low | Token-budget | | Warm | **SQLite stub** | Medium | Decision-count | | Cold | **File stub** | High | Decision-count | The warm tier should persist to SQLite so that decision history survives process restarts. The cold tier should persist to files for unlimited capacity. ## Actual Behavior In `ContextTierService.__init__()`: ```python # --- tier stores --- self._hot: dict[str, TieredFragment] = {} self._warm: dict[str, TieredFragment] = {} # ⚠️ Should be SQLite-backed self._cold: dict[str, TieredFragment] = {} # ⚠️ Should be file-backed ``` All three tiers are plain in-memory dicts. When the process restarts: - All warm-tier fragments (decision history) are lost - All cold-tier fragments (archived context) are lost - The `plan-decision-context` strategy cannot retrieve historical decisions from previous sessions - The `temporal-archaeology` strategy cannot retrieve archived context from previous sessions ## Impact - Context history does not persist across process restarts - The warm/cold tier capacity limits (`max_decisions_warm=500`, `max_decisions_cold=5000`) are enforced in-memory only - The `ContextTierService` is described as single-threaded in its docstring, which is consistent with in-memory storage, but the spec requires persistence ## Code Location `src/cleveragents/application/services/context_tiers.py` — `ContextTierService.__init__()`, `_hot`, `_warm`, `_cold` attributes. ## Note The `docs/reference/context_tiers.md` table labels warm as "SQLite stub" and cold as "File stub", suggesting this is a known planned improvement. This issue tracks the gap between the documented behavior and the actual implementation. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core#5519
No description provided.