Proposal: update specification — document context_tier_hydrator module in ACMS architecture section #6175

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

Specification Update Proposal

Triggered by: Merged PR #4219 (fix(acms): wire ACMS indexing pipeline into CLI so ContextTierService is populated during context operations)


What Changed in the Implementation

PR #4219 introduced a new module src/cleveragents/application/services/context_tier_hydrator.py that:

  1. Bridges the gap between the resource registry (files on disk) and the ACMS context tier (in-memory fragments)
  2. Provides two public functions:
    • hydrate_tiers_for_plan(tier_service, project_names, project_repository, resource_registry) -> int — hydrates all projects linked to a plan
    • hydrate_tiers_from_project(tier_service, project_name, resource_id, resource_location, resource_type) -> int — hydrates a single project resource
  3. Uses git ls-files for git-checkout resources, falls back to os.walk for others
  4. Enforces limits: max 256 KB per file, max 10 MB total per project
  5. Skips binary files and common non-source directories (.git, node_modules, __pycache__, etc.)
  6. Stores TieredFragment objects in ContextTierService with ContextTier.HOT tier
  7. Metadata values detail_depth and relevance_score are stored as strings (not int/float) — this was a bug fix in PR #5998

This module resolves bug #1028 where ContextTierService started empty on every CLI invocation, leaving the LLM with zero file context during plan execution.


What Spec Section(s) Need Updating

Current spec state: The context_tier_hydrator module does not appear anywhere in the 47,040-line specification. The ACMS section (§Architecture, ~line 43167+) describes the ACMS pipeline conceptually but does not document the hydration step that populates ContextTierService before context assembly.

Proposed addition: Add a subsection to the ACMS architecture section (§Architecture → ACMS) documenting:

  1. Context Tier Hydration — the process of populating ContextTierService from linked project resources before context assembly
  2. context_tier_hydrator module — its two public functions, their signatures, and their behavior
  3. File listing strategygit ls-files for git-checkout resources, os.walk fallback
  4. Size/budget limits — 256 KB per file, 10 MB total per project
  5. Fragment structureTieredFragment with ContextTier.HOT, metadata keys path, detail_depth (string), relevance_score (string)
  6. Integration point — hydration runs before context assembly in LLMExecuteActor.execute()

Rationale

The implementation discovered a critical missing step in the ACMS pipeline: without hydration, the LLM receives zero file context. This is a genuine architectural improvement that the spec must document. The hydration module is a stable, tested component (6 Behave scenarios) that is now part of the production code path.


Scope

  • Section: ## Architecture → ACMS subsection (~line 43167+)
  • Change type: Addition (new subsection)
  • Size: ~30-50 lines of new spec content
  • Impact: No existing spec content needs to be removed or changed; this is purely additive

Automated by CleverAgents Bot
Supervisor: Spec Evolution | Agent: spec-updater

## Specification Update Proposal **Triggered by**: Merged PR #4219 (`fix(acms): wire ACMS indexing pipeline into CLI so ContextTierService is populated during context operations`) --- ## What Changed in the Implementation PR #4219 introduced a new module `src/cleveragents/application/services/context_tier_hydrator.py` that: 1. Bridges the gap between the resource registry (files on disk) and the ACMS context tier (in-memory fragments) 2. Provides two public functions: - `hydrate_tiers_for_plan(tier_service, project_names, project_repository, resource_registry) -> int` — hydrates all projects linked to a plan - `hydrate_tiers_from_project(tier_service, project_name, resource_id, resource_location, resource_type) -> int` — hydrates a single project resource 3. Uses `git ls-files` for git-checkout resources, falls back to `os.walk` for others 4. Enforces limits: max 256 KB per file, max 10 MB total per project 5. Skips binary files and common non-source directories (`.git`, `node_modules`, `__pycache__`, etc.) 6. Stores `TieredFragment` objects in `ContextTierService` with `ContextTier.HOT` tier 7. Metadata values `detail_depth` and `relevance_score` are stored as **strings** (not int/float) — this was a bug fix in PR #5998 This module resolves bug #1028 where `ContextTierService` started empty on every CLI invocation, leaving the LLM with zero file context during plan execution. --- ## What Spec Section(s) Need Updating **Current spec state**: The `context_tier_hydrator` module does not appear anywhere in the 47,040-line specification. The ACMS section (§Architecture, ~line 43167+) describes the ACMS pipeline conceptually but does not document the hydration step that populates `ContextTierService` before context assembly. **Proposed addition**: Add a subsection to the ACMS architecture section (§Architecture → ACMS) documenting: 1. **Context Tier Hydration** — the process of populating `ContextTierService` from linked project resources before context assembly 2. **`context_tier_hydrator` module** — its two public functions, their signatures, and their behavior 3. **File listing strategy** — `git ls-files` for git-checkout resources, `os.walk` fallback 4. **Size/budget limits** — 256 KB per file, 10 MB total per project 5. **Fragment structure** — `TieredFragment` with `ContextTier.HOT`, metadata keys `path`, `detail_depth` (string), `relevance_score` (string) 6. **Integration point** — hydration runs before context assembly in `LLMExecuteActor.execute()` --- ## Rationale The implementation discovered a critical missing step in the ACMS pipeline: without hydration, the LLM receives zero file context. This is a genuine architectural improvement that the spec must document. The hydration module is a stable, tested component (6 Behave scenarios) that is now part of the production code path. --- ## Scope - **Section**: `## Architecture` → ACMS subsection (~line 43167+) - **Change type**: Addition (new subsection) - **Size**: ~30-50 lines of new spec content - **Impact**: No existing spec content needs to be removed or changed; this is purely additive --- **Automated by CleverAgents Bot** Supervisor: Spec Evolution | Agent: spec-updater
HAL9000 added this to the v3.4.0 milestone 2026-04-10 18:43:16 +00:00
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#6175
No description provided.