Files
cleveragents-core/features/context_tier_hydration.feature
T
hamza.khyari 5d0e739e43 fix(acms): wire ACMS indexing pipeline into CLI so ContextTierService is populated during plan execution
ContextTierService started empty on every CLI invocation, so the LLM
received zero file context during plan execution (bug #1028).

- Add context_tier_hydrator.py: reads files from linked project resources
  (via git ls-files or os.walk) and stores them as TieredFragment objects
  in the tier service.  Respects max file size (256 KB), total budget
  (10 MB), binary exclusion, and .git/node_modules/__pycache__ skipping.
- Wire hydration into LLMExecuteActor.execute() via lazy import (avoids
  M1 E2E regression from top-level import).
- Inject tier_service, project_repository, resource_registry into
  LLMExecuteActor from the DI container in _get_plan_executor().
- Add tier_service property to ExecutePhaseContextAssembler.
- Suppress exc_info traceback rendering in context warnings to prevent
  false-positive crash detection in M1 E2E tests.
- Add sandbox file-writing support in plan apply (path traversal guards,
  protected directory skipping).
- Add 6 Behave scenarios for context tier hydration.

Closes #1028
2026-04-09 13:00:47 +00:00

40 lines
1.9 KiB
Gherkin

@context-hydration
Feature: Context tier hydration from linked resources (#1028)
Verifies that ContextTierService is populated from project
resources before LLM context assembly.
Scenario: Hydrate tiers from git-checkout resource for ctx_hydrate
Given a temp git repo with 2 files for ctx_hydrate
And a ContextTierService instance for ctx_hydrate
When I hydrate tiers from the resource for ctx_hydrate
Then the tier service should have 2 fragments for ctx_hydrate
Scenario: Hydrate skips binary files for ctx_hydrate
Given a temp dir with 1 text and 1 binary file for ctx_hydrate
And a ContextTierService instance for ctx_hydrate
When I hydrate tiers from the resource for ctx_hydrate
Then the tier service should have 1 fragment for ctx_hydrate
Scenario: Hydrate skips files over size limit for ctx_hydrate
Given a temp dir with 1 large file for ctx_hydrate
And a ContextTierService instance for ctx_hydrate
When I hydrate tiers from the resource for ctx_hydrate
Then the tier service should have 0 fragments for ctx_hydrate
Scenario: Hydrate sets project_name on fragments for ctx_hydrate
Given a temp dir with 1 text file for ctx_hydrate
And a ContextTierService instance for ctx_hydrate
When I hydrate tiers from the resource for ctx_hydrate
Then each fragment project_name should be "local/test-project" for ctx_hydrate
Scenario: Hydrate sets resource_id on fragments for ctx_hydrate
Given a temp dir with 1 text file for ctx_hydrate
And a ContextTierService instance for ctx_hydrate
When I hydrate tiers from the resource for ctx_hydrate
Then each fragment resource_id should not be empty for ctx_hydrate
Scenario: Hydrate returns 0 for missing location for ctx_hydrate
Given a ContextTierService instance for ctx_hydrate
When I hydrate tiers from a missing location for ctx_hydrate
Then the hydration count should be 0 for ctx_hydrate