Files
cleveragents-core/features/plan_executor_tier_hydration.feature
brent.edwards eb46f0ff54
CI / push-validation (push) Successful in 40s
CI / helm (push) Successful in 44s
CI / build (push) Successful in 1m14s
CI / lint (push) Successful in 1m18s
CI / quality (push) Successful in 1m36s
CI / e2e_tests (push) Successful in 1m19s
CI / typecheck (push) Successful in 2m22s
CI / security (push) Successful in 2m23s
CI / benchmark-regression (push) Failing after 41s
CI / integration_tests (push) Successful in 4m46s
CI / unit_tests (push) Failing after 20m13s
CI / benchmark-publish (push) Failing after 28m28s
CI / coverage (push) Has been cancelled
CI / docker (push) Has been cancelled
CI / status-check (push) Has been cancelled
fix(plan): add tier hydration and improve architecture review output (#10938)
## Summary

This PR fixes issue #10878 where architecture reviews were truncated because the regex pattern for parsing file output would stop at the first ``` encountered in the Markdown report.

## Changes

- Change file delimiters from ``` to >>>>>>>/<<<<<<< to avoid Markdown conflicts
- Add tier hydration before strategize phase in plan_executor.py
- Increase max_tokens to 16384 in llm_actors.py for longer outputs
- Increase context_max_tokens_hot from 16000 to 32000 in settings.py
- Fix get_hot_view → get_hot_fragments in strategy_actor.py and plan_executor.py
- Add opencode to skip directories in context_tier_hydrator.py
- Change sandbox output location to plan-output/ directory in plan.py
- Add get_context_summary stub method to acms_service.py

## Testing

Run architecture review action and verify the output report is complete with all sections.

Reviewed-on: #10938
2026-05-19 12:43:34 +00:00

65 lines
3.3 KiB
Gherkin

@tdd @tdd_issue @tdd_issue_10938 @tier-hydration
Feature: Tier hydrator integration in PlanExecutor run_strategize (#10938)
Verifies that PlanExecutor.run_strategize correctly:
- Calls hydrate_tiers_for_plan when tier_service, project_repository, and
resource_registry are all wired
- Skips hydration if this plan_id has already been hydrated by this executor
instance (plan-id-scoped cache, prevents cross-plan contamination)
- Catches hydration failures without aborting the strategize phase
Forgejo: #10938
# -------------------------------------------------------------------
# Success hydrate_tiers_for_plan is called when all dependencies exist
# -------------------------------------------------------------------
Scenario: Hydration is invoked when tier_service, project_repository and resource_registry are present
Given a mock PlanExecutor with tier_service, project_repository and resource_registry wired in
And a plan in the Strategize phase
When I call run_strategize on that PlanExecutor
Then hydrate_tiers_for_plan should have been called once
And the plan executor strategize result should be a valid run_strategize response
# -------------------------------------------------------------------
# Cache — skip already-hydrated tiers (new block from PR #10938)
# -------------------------------------------------------------------
Scenario: Hydration is skipped when plan_id has already been hydrated by this executor
Given a mock PlanExecutor with tier_service and plan_id already marked as hydrated
And a plan in the Strategize phase
When I call run_strategize on that PlanExecutor
Then hydrate_tiers_for_plan should not have been called because the plan was already hydrated
And the plan executor strategize result should be a valid run_strategize response
Scenario: Hydration runs when hot tier is empty
Given a mock PlanExecutor with tier_service but no pre-existing hot fragments
And a plan in the Strategize phase
When I call run_strategize on that PlanExecutor
Then hydrate_tiers_for_plan should have been called once
# -------------------------------------------------------------------
# Failure — hydration failure does not block strategize (new try/except from PR #10938)
# -------------------------------------------------------------------
Scenario: Hydration OSError is caught non-fatally and strategize continues
Given a mock PlanExecutor with tier_service, project_repository and resource_registry where hydrate fails with OSError
And a plan in the Strategize phase
When I call run_strategize on that PlanExecutor
Then hydrate_tiers_for_plan should have been called once
Then the strategy result should contain decisions (strategize succeeded despite hydration failure)
# -------------------------------------------------------------------
# No-op — tier_service not wired does not crash
# -------------------------------------------------------------------
Scenario: Strategize proceeds when tier_service is None (no hydration attempted)
Given a mock PlanExecutor without tier_service
And a plan in the Strategize phase
When I call run_strategize on that PlanExecutor
Then hydrate_tiers_for_plan should not have been called
And the plan executor strategize result should be a valid run_strategize response