UAT: ContextTierService is in-memory only — no persistence across process restarts, violating spec's "cold is persistent storage" requirement #5603

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

Bug Report

Feature Area: Context Assembly Pipeline — Hot/Warm/Cold Storage Tiers

Severity: Critical (milestone-blocking — v3.4.0 deliverable #7: "Hot/warm/cold tier management functional")

What Was Tested

Code-level analysis of src/cleveragents/application/services/context_tiers.py against the specification's tier persistence requirements.

Expected Behavior (from spec §46865)

The spec states: "Tier eviction: Hot tier evicts to warm on overflow; warm evicts to cold on age threshold; cold is persistent storage."

The cold tier is described as persistent storage — it should survive process restarts. This is the fundamental purpose of the cold tier: to store context that is too old for warm but still potentially useful.

Actual Behavior (from code)

ContextTierService.__init__() initializes all three tiers as plain Python dicts:

# --- tier stores ---------------------------------------------------
self._hot: dict[str, TieredFragment] = {}
self._warm: dict[str, TieredFragment] = {}
self._cold: dict[str, TieredFragment] = {}

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

  • All hot, warm, AND cold fragments are lost
  • There is no database persistence layer for tier fragments
  • The ContextTierService is registered as a Singleton in the DI container (application/container.py line 715), which means it persists within a process but not across restarts

The spec's requirement that "cold is persistent storage" is not met.

Code Location

  • src/cleveragents/application/services/context_tiers.py lines ~100–115 (__init__ tier store initialization)
  • src/cleveragents/application/container.py line 715 (Singleton registration)

Impact

  • Cold-tier fragments are lost on process restart
  • The spec's "cold is persistent storage" requirement is not met
  • v3.4.0 deliverable #7 ("Hot/warm/cold tier management functional") is not fully met
  • Context that was accumulated over time is lost when the agent process restarts

Fix Direction

The cold tier should be backed by a persistent store (e.g., SQLite table or file-based storage). The ContextTierService should load cold-tier fragments from the persistent store on initialization and flush to it on demotion/eviction.


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

## Bug Report **Feature Area**: Context Assembly Pipeline — Hot/Warm/Cold Storage Tiers **Severity**: Critical (milestone-blocking — v3.4.0 deliverable #7: "Hot/warm/cold tier management functional") ### What Was Tested Code-level analysis of `src/cleveragents/application/services/context_tiers.py` against the specification's tier persistence requirements. ### Expected Behavior (from spec §46865) The spec states: "Tier eviction: Hot tier evicts to warm on overflow; warm evicts to cold on age threshold; **cold is persistent storage**." The cold tier is described as persistent storage — it should survive process restarts. This is the fundamental purpose of the cold tier: to store context that is too old for warm but still potentially useful. ### Actual Behavior (from code) `ContextTierService.__init__()` initializes all three tiers as plain Python dicts: ```python # --- tier stores --------------------------------------------------- self._hot: dict[str, TieredFragment] = {} self._warm: dict[str, TieredFragment] = {} self._cold: dict[str, TieredFragment] = {} ``` All three tiers are in-memory only. When the process restarts: - All hot, warm, AND cold fragments are lost - There is no database persistence layer for tier fragments - The `ContextTierService` is registered as a `Singleton` in the DI container (`application/container.py` line 715), which means it persists within a process but not across restarts The spec's requirement that "cold is persistent storage" is not met. ### Code Location - `src/cleveragents/application/services/context_tiers.py` lines ~100–115 (`__init__` tier store initialization) - `src/cleveragents/application/container.py` line 715 (Singleton registration) ### Impact - Cold-tier fragments are lost on process restart - The spec's "cold is persistent storage" requirement is not met - v3.4.0 deliverable #7 ("Hot/warm/cold tier management functional") is not fully met - Context that was accumulated over time is lost when the agent process restarts ### Fix Direction The cold tier should be backed by a persistent store (e.g., SQLite table or file-based storage). The `ContextTierService` should load cold-tier fragments from the persistent store on initialization and flush to it on demotion/eviction. --- **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.

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