feat(plan): add large-project decomposition and dependency closure #531

Merged
freemo merged 1 commits from feature/m6-large-decompose into master 2026-03-03 21:49:10 +00:00
Owner

Summary

  • Add hierarchical decomposition with 4+ levels and bounded context per subplan
  • Implement decomposition heuristics (max_files_per_subplan, max_tokens_per_subplan, language/dir clustering)
  • Add dependency closure computation for large graphs and DAG execution ordering
  • Add bounded dependency closure with cutoff thresholds and memoization for 10K+ files
  • Record decomposition decisions in DecisionService (strategy_choice + subplan_spawn entries)

New Modules

Module Lines Purpose
decomposition_models.py ~210 DecompositionConfig, DecompositionNode, DecompositionResult, DependencyEdge, DependencyGraph
decomposition_clustering.py ~200 ClusteringStrategy with directory, language, size clustering + deterministic sort
decomposition_graph.py ~190 DependencyClosureComputer with bounded closure, topological sort, cycle detection, memoization
decomposition_service.py ~290 DecompositionService orchestrating hierarchy building and decision recording

Settings

  • planner_max_depth (default: 4)
  • planner_max_files_per_subplan (default: 500)
  • planner_max_tokens_per_subplan (default: 100000)
  • planner_min_files_per_subplan (default: 10)

Tests

  • 19 Behave BDD scenarios covering all acceptance criteria
  • 6 Robot Framework smoke tests
  • ASV benchmarks for decomposition and closure performance

Quality Gates

  • nox -s lint — passed
  • nox -s typecheck — 0 errors, 0 warnings
  • nox -s unit_tests -- features/large_project_decomposition.feature — 19/19 scenarios passed

Closes #205

## Summary - Add hierarchical decomposition with 4+ levels and bounded context per subplan - Implement decomposition heuristics (max_files_per_subplan, max_tokens_per_subplan, language/dir clustering) - Add dependency closure computation for large graphs and DAG execution ordering - Add bounded dependency closure with cutoff thresholds and memoization for 10K+ files - Record decomposition decisions in DecisionService (strategy_choice + subplan_spawn entries) ## New Modules | Module | Lines | Purpose | |--------|-------|---------| | `decomposition_models.py` | ~210 | DecompositionConfig, DecompositionNode, DecompositionResult, DependencyEdge, DependencyGraph | | `decomposition_clustering.py` | ~200 | ClusteringStrategy with directory, language, size clustering + deterministic sort | | `decomposition_graph.py` | ~190 | DependencyClosureComputer with bounded closure, topological sort, cycle detection, memoization | | `decomposition_service.py` | ~290 | DecompositionService orchestrating hierarchy building and decision recording | ## Settings - `planner_max_depth` (default: 4) - `planner_max_files_per_subplan` (default: 500) - `planner_max_tokens_per_subplan` (default: 100000) - `planner_min_files_per_subplan` (default: 10) ## Tests - 19 Behave BDD scenarios covering all acceptance criteria - 6 Robot Framework smoke tests - ASV benchmarks for decomposition and closure performance ## Quality Gates - `nox -s lint` — passed - `nox -s typecheck` — 0 errors, 0 warnings - `nox -s unit_tests -- features/large_project_decomposition.feature` — 19/19 scenarios passed Closes #205
freemo force-pushed feature/m6-large-decompose from 45e00b16f6 to df163808d7 2026-03-03 18:50:13 +00:00 Compare
freemo scheduled this pull request to auto merge when all checks succeed 2026-03-03 18:50:29 +00:00
freemo force-pushed feature/m6-large-decompose from df163808d7 to f92576e2a6 2026-03-03 20:50:42 +00:00 Compare
freemo force-pushed feature/m6-large-decompose from f92576e2a6 to 6bcf05efe7 2026-03-03 21:25:43 +00:00 Compare
freemo scheduled this pull request to auto merge when all checks succeed 2026-03-03 21:26:04 +00:00
freemo force-pushed feature/m6-large-decompose from 6bcf05efe7 to 4232907ab9 2026-03-03 21:44:24 +00:00 Compare
freemo merged commit 4232907ab9 into master 2026-03-03 21:49:10 +00:00
freemo deleted branch feature/m6-large-decompose 2026-03-03 21:49:10 +00:00
freemo added the
State
Completed
label 2026-03-04 00:41:34 +00:00
Sign in to join this conversation.
No Reviewers
No Label
State
Completed
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: cleveragents/cleveragents-core#531